Wikipedia:Reference desk/Archives/Computing/2023 March 8

Computing desk
< March 7 << Feb | March | Apr >> March 9 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


March 8

edit

Resizing svg files

edit

I have a bunch of svg files that I can convert (one by one) to pdf using Inkscape. Unfortunately, the output has 75% of the size I'd like to see. What is an easy way to get pdf files that (printed "as is") are about 33% larger. Can that be done with a wrapper around the svg files, or is there some other (free) app that runs on macOS and can take care of the resizing.  --Lambiam 15:27, 8 March 2023 (UTC)[reply]

I found an online site (https://avepdf.com/resize-pdf) that allowed me to scale up to 133%. It took some time to do this for each file – no batch submission – but for now my problem is solved.  --Lambiam 17:53, 8 March 2023 (UTC)[reply]
You are mixing "svg" and "pdf" in your question as though they are the same thing. SVG is a graphics format that has no inherent size. You can print it microscopic or as a building mural without any form of lossiness. PDF is an envelope structure that can contain many things of many different formats. It could contain and SVG. If it does contain an SVG, it will certainly impose a size on the SVG. The SVG itself has no size. The PDF says "print that SVG at XXX size." Your solution of resizing the PDF has the effect of the PDF telling the embedded SVG to print larger. If you had the actual SVG, you could open it in any SVG editor (Inkscape) and print it any size you like. 97.82.165.112 (talk) 20:59, 8 March 2023 (UTC)[reply]
I am not actually printing these files but sending them to someone else, who uses them as input to some automated image transformation process that requires pdf input. All I know is that when I convert them to pdf using Inkscape's "Save as", they come out at 75% of what they should be in a pdf reader. I have no idea what the appropriate printing size is, but the recipient's process failed because of the size mismatch.  --Lambiam 00:42, 9 March 2023 (UTC)[reply]
Just a note that to be technical, it is very unlikely your PDF contains an SVG. PDF is a complicated format and can contain attachments so I assume you could attach an SVG, but this would be as file you would open in some other program. Vector graphics are an essential part of the PDF format but AFAIK they only ever use their own format which is based significantly on what's done in PostScript (as that's what PDF derives from). Note that while newer versions of PDF have added more vector features, AFAIK they're still fairly limited compared to what's possible in SVG. So depending on what your SVG contains, it may be the case that some stuff is rasterised when saving to PDF. According to sources like [1] [2], Inkscape does actually have a concept of document size. (And it sounds like it's also possible to set the DPI of any rasterisation.) I imagine changing this will change the output size of the PDF. Note that from [3], I think SVG can actually store a 'document size' as well, so I don't think the IP's comment is quite correct. It's not something most software will care about or which makes any difference. But other than InkScape or exports to PDF generally, I suspect other software with its own concept of a document size e.g. Word will probably import the SVG as the document size by default. Nil Einne (talk) 09:05, 12 March 2023 (UTC)[reply]
Changing the resolution for rasterization in Inkscape when saving the SVG file as PDF did not change the size of the printed PDF. I think it should be possible to apply a textual modification to the SVG file that effectuates a scaling transformation of the image.  --Lambiam 00:24, 14 March 2023 (UTC)[reply]