PDF bitmap export resolution

Post questions on how to use or achieve an effect in Inkscape.
batfastad
Posts: 12
Joined: Thu Mar 13, 2008 11:34 pm

PDF bitmap export resolution

Postby batfastad » Thu Oct 04, 2012 11:41 pm

Hi everyone

I've written a small wrapper GUI to the Inkscape command line for batch converting SVGs to PDF/EPS/PNG. This is a task that I have to do on a very regular basis so this saves me plenty of time.

One thing I had never noticed before is that the dpi setting doesn't affect the resultant PDF, in terms of embedded bitmap graphics. The dpi setting only applies to the rasterisation of effects.

I'd like to know why this is?

Is it because when you have raster images embedded in an SVG (as I frequently have to), they are exported to the PDF and embedded at exactly the same size as in the SVG?
All Inkscape does is export the vector/bitmap data to vector/bitmap in the PDF (unless you have filters/effects that will be rasterised).
So if I wanted to downsample the images in the PDF to reduce file size, I guess I have to do that in Acrobat/Distiller. That's fine, just wanted to check.

Cheers, B

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: PDF bitmap export resolution

Postby ~suv » Fri Oct 05, 2012 9:33 pm

The PDF export setting 'Resolution for rasterization (dpi)' refers to the rasterization of filter effects (see setting right above "Rasterize filter effects [x]"): It only affects the rasterization of SVG filter effects, and is not related to resampling of embedded or linked bitmap images (Inkscape cannot resample bitmap images when exporting to PDF).

See also the related section in the manual:
Inkscape » Files » Exporting Files

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: PDF bitmap export resolution

Postby ~suv » Fri Oct 05, 2012 9:51 pm

batfastad wrote:I'd like to know why this is?
Could you give some more hints what kind of an answer you expect? Technical information, links to related sections in the current code base (stable release branch), or a POV on how opensource development works (based on volunteer work, patches are welcome), or an answer giving a summary of a search in the archives of the developers' mailing list for any clues why no one implemented related feature requests so far?

Note that with the new cairo-renderer in current development builds, resampling of bitmap images doesn't work even for display on-canvas or bitmap export (because apparently there is no good solution available in the (external) libraries used for the new renderer). I don't know if this would also be affecting or preventing a quick solution for PDF export (which in Inkscape is done by using the same external libraries: cairo/pixman).

batfastad
Posts: 12
Joined: Thu Mar 13, 2008 11:34 pm

Re: PDF bitmap export resolution

Postby batfastad » Fri Oct 05, 2012 11:34 pm

I'm not criticising in the slightest, quite the reverse! I have been using Inkscape extensively for many years and it's fantastic to see increased usage of the SVG format on the web, especially with the new features in HTML 5.

I'm not looking for technical information, I'd just like to know the following...
Is the size/format of a bitmap that's embedded in the exported PDF exactly the same format/size/resolution as the bitmap embedded in the SVG?
So bitmap images are basically just copied over to the PDF container?

Also on a vaguely related matter... is there a reason why the page in Inkscape and the page in a PDF viewer (SumatraPDF in this case but same is true with Acrobat) appear to be different sizes even though both are zoomed to 100%?
inkscapepdfdiffsize.gif
different size in Inkscape vs PDF even when both zoomed to 100%
inkscapepdfdiffsize.gif (145.8 KiB) Viewed 5134 times


Cheers, B


Return to “Help with using Inkscape”