I have a pdf file that is generated from a scanned/pictured image, but it's upside down. I used Inkscape to rotate the content and using the default option to save the pdf file, then I found the file size changed from 1.5MB to 8.8MB. Any ideas on this issue? The vast increase in file size would probably be unacceptable.
The vector content in your images is largely independent of dpi. Whether the vector content is scaled to 10cm or 50cm then saved as svg or pdf, it should have roughly the same file size within a few kb. ( Allowing for transform code etc )
Assuming we are talking about embedded not linked content.
When you save an svg containing bitmap data Inkscape will contain a base64 encoded version of the image, this can be jpeg or png.
There will also be a list of transforms: scale / rotate etc along with style statement which links to any filters you have used. This is simply a list of text which goes along side the orignal image - so takes up very little space.
If you open the svg in a browser however you will find that some filters look quite different depending upon how the browser chooses to interpret them.
PDF is designed to give consistent results over different platforms.
The bitmap data in the pdf may have to be re-rendered, so that will include bitmap scaling to the chosen dpi instead of using a text transform. Also rendering all of the filters instead of using style references.
After re-rendering the image data in the pdf is usually png. It could also be considerably larger in resolution depending on you inkscape image dimensions and output dpi (even if no new data is added).
On linux it's easy to solve and examine.
The image contents of the new pdf can be extracted to a folder (pdfout) :
I suggest to use gimp to manipulate image, you can also use it to export in PDF and if you are in Linux the best way to convert a scan in PDF is through imagemagick...
I have a pdf file that is generated from a scanned/pictured image, but it's upside down. I used Inkscape to rotate the content and using the default option to save the pdf file, then I found the file size changed from 1.5MB to 8.8MB. Any ideas on this issue? The vast increase in file size would probably be unacceptable.
Yes.
The vector content in your images is largely independent of dpi. Whether the vector content is scaled to 10cm or 50cm then saved as svg or pdf, it should have roughly the same file size within a few kb. ( Allowing for transform code etc )
Assuming we are talking about embedded not linked content.
When you save an svg containing bitmap data Inkscape will contain a base64 encoded version of the image, this can be jpeg or png.
There will also be a list of transforms: scale / rotate etc along with style statement which links to any filters you have used. This is simply a list of text which goes along side the orignal image - so takes up very little space.
If you open the svg in a browser however you will find that some filters look quite different depending upon how the browser chooses to interpret them.
PDF is designed to give consistent results over different platforms.
The bitmap data in the pdf may have to be re-rendered, so that will include bitmap scaling to the chosen dpi instead of using a text transform. Also rendering all of the filters instead of using style references.
After re-rendering the image data in the pdf is usually png. It could also be considerably larger in resolution depending on you inkscape image dimensions and output dpi (even if no new data is added).
On linux it's easy to solve and examine.
The image contents of the new pdf can be extracted to a folder (pdfout) :
pdfimage -all 1.pdf ./pdfout
p2pdf 1.pdf 1.pdf will produce a nice small pdf ( there are loads of different settings http://web.mit.edu/ghostscript/www/Ps2pdf.htm )
https://wiki.inkscape.org/wiki/index.php/Frequently_asked_questions#Why_do_images_.22grow.22_when_imported_into_Inkscape.3F
I suggest to use gimp to manipulate image, you can also use it to export in PDF and if you are in Linux the best way to convert a scan in PDF is through imagemagick...