View Full Version : How to resize my pdf?


bthoven
03-29-2010, 02:25 AM
I have a rasterized pdf (scanned image) which size is too big.

I wish to scale the size down (its size is 6.97"x4.09", want to scale down to 4.5" high).

Any freeware allows me to do this?

WillAdams
03-29-2010, 08:41 AM
Any bitmap editor which supports the import of .pdfs should allow you to do this, GIMP is one free program which will (use GhostScript to) import .pdfs.

William

TGS
03-29-2010, 03:41 PM
The other option is to get the text out of the PDF with an OCR programme - Abbyy FineReader is good. Once you've got the text you can do what you want with it - resize it, reflow it - in a word processing programme and then print to PDF again.

frabjous
03-29-2010, 03:53 PM
I'm curious exactly why you want to do this. Just about every PDF reader, certainly on portable devices, will automatically scale the PDF to match the size of the screen.

Is this for the purpose of printing, or ...?

bthoven
03-30-2010, 04:14 AM
Any bitmap editor which supports the import of .pdfs should allow you to do this, GIMP is one free program which will (use GhostScript to) import .pdfs.

William

Thanks. As there are around two hundred pages, GIMP will import them into layers of images. My questions are:

1. After editing in GIMP, which format should I save them? save in layers? because I can't save them as pdf direct from GIMP.
2. How to convert it back to multi-page pdf?

Thanks

bthoven
03-30-2010, 04:39 AM
I'm curious exactly why you want to do this. Just about every PDF reader, certainly on portable devices, will automatically scale the PDF to match the size of the screen.

Is this for the purpose of printing, or ...?

Hi,

As the document page is too long, when autofit in Nook, the text is too small with lot of blank space on the right. I wish I can compress the height of the page a bit; or to make the page height vs width scale fit my Nook. This should make the text look bigger on my Nook.

bthoven
03-30-2010, 04:49 AM
The other option is to get the text out of the PDF with an OCR programme - Abbyy FineReader is good. Once you've got the text you can do what you want with it - resize it, reflow it - in a word processing programme and then print to PDF again.

Hi,

Thanks for your suggestion. The document looks quite dirty because it was scanned from a very old book. The text is also in Thai which current local OCR software is still not good enough to produce accurate text out of it.

frabjous
03-30-2010, 10:43 AM
As the document page is too long, when autofit in Nook, the text is too small with lot of blank space on the right. I wish I can compress the height of the page a bit; or to make the page height vs width scale fit my Nook. This should make the text look bigger on my Nook.

Scaling the page will not help with this problem. It shows the whitespace because the proportions (height/width ratio) of the page do not match that of the nook. Resizing the page while keeping the same proportions will do exactly nothing. There isn't that much you can do about that, but the best thing to do would be to trim the whitespace, i.e., crop the PDF, not resize it. Ignore all the instructions above.

There are some instructions in this thread (http://www.mobileread.com/forums/showthread.php?t=77591) for cropping scanned PDFs.

You could also try soPDF (http://www.mobileread.com/forums/showthread.php?t=32066=) or PaperCrop (http://www.mobileread.com/forums/showthread.php?t=31677) or PDFread (http://www.mobileread.com/forums/showthread.php?t=21906).

bthoven
03-30-2010, 11:50 AM
Scaling the page will not help with this problem. It shows the whitespace because the proportions (height/width ratio) of the page do not match that of the nook. Resizing the page while keeping the same proportions will do exactly nothing. There isn't that much you can do about that, but the best thing to do would be to trim the whitespace, i.e., crop the PDF, not resize it. Ignore all the instructions above.

There are some instructions in this thread (http://www.mobileread.com/forums/showthread.php?t=77591) for cropping scanned PDFs.

You could also try soPDF (http://www.mobileread.com/forums/showthread.php?t=32066=) or PaperCrop (http://www.mobileread.com/forums/showthread.php?t=31677) or PDFread (http://www.mobileread.com/forums/showthread.php?t=21906).

Yes..that's what I intend to do. There is no white margins at all in the document, each page is just too long. I have to change the proportion of the pages to be same as my Nook width:height proportion.

I already use GIMP to import, change the proportion, and save it in gif and xcf as layered image file. I don't know how to convert it further to pdf? The preview of the new proportion still looks good and very readable.

frabjous
03-30-2010, 03:57 PM
Are you cutting the pages into proportionally correct sized chunks, or are you actually stretching the text or images disproportionately to match the Nook's size?

Hey, if it still looks good, more power to you. I would think this would usually result is something fairly awful looking, however...

Either way, I wouldn't think that the GIMP is the right tool for this job. (Although I am a big fan of the GIMP in general.)

For cutting into appropriately sized chunks, one thing could you try is processing with PDFLRF (http://www.mobileread.com/forums/showthread.php?t=13135) and then use calibre to convert the resultant LRF to something Nook can read (ePub or whatever).

For stretching, I'd probably bypass the GIMP altogether and write a script for ImageMagick (http://www.imagemagick.org/) that does it all automatically. (E.g., burst a PDF into multiple images, batch resize the pages, etc.) ImageMagick can also convert multiple images, or a multi-layer image, into a multipage PDF.

E.g.:

convert *.gif -adjoin output.pdf

Will combine all the .gifs in the directory into output.pdf.

if I knew a bit more about exactly what the workflow is, I might be able to help with the script, though I'm by no means an expert.

bthoven
03-30-2010, 11:50 PM
Thanks frabjous...you're very helpful.

I use gimp to stretch (should say squeeze) the image and now saved as multi-layer gif.

It seems there is no tool to convert such a multi-layer gif file to multi-page pdf.

frabjous
03-30-2010, 11:55 PM
ImageMagick will also convert multilayer gifs to multipage PDFs.

convert mymultilayer.gif mymultipage.pdf

bthoven
03-31-2010, 12:18 AM
ImageMagick will also convert multilayer gifs to multipage PDFs.

convert mymultilayer.gif mymultipage.pdf

Thanks..it works!

The problem are:

1. size increase two folds (from 9MB to 17MB). Size increased at pdf-to-gif process by gimp. The imagemagick just increased size a bit.
2. the output file show pages in reverse order, ie. last page show first. I have to reverse layer order in gimp before using imagemagick. Is there an option in imagemagick to reverse layer order when producing pdf file?
Thanks

frabjous
03-31-2010, 12:40 AM
Try:

convert mymultilayer.gif -reverse mymultipage.pdf

Not sure what can be done about the file size offhand, but I'll give it some thought.

bthoven
03-31-2010, 01:14 AM
Try:

convert mymultilayer.gif -reverse mymultipage.pdf

Not sure what can be done about the file size offhand, but I'll give it some thought.

Thanks..that reverse option works!:2thumbsup

frabjous
03-31-2010, 10:03 AM
Cool.

By the way, if you want to cut out the "middle man", and just have ImageMagick do the resizing, you can use:

convert input.pdf -resize 600x800! output.pdf

The units for -resize are pixels, 1/72th of an inch. It'll do every page. The exclamation mark is needed if you want to lose the aspect ratio.

Very handy if put in a batch file to do an entire directory (or more) at once. Let me know if you'd need help with that. (I'd need to know your operating system.)

TGS
03-31-2010, 11:46 AM
Hi,

Thanks for your suggestion. The document looks quite dirty because it was scanned from a very old book. The text is also in Thai which current local OCR software is still not good enough to produce accurate text out of it.

Have you tried AnyBizSoft PDF to Word converter. It says it supports Thai and presumably once it's in Word you could tidy it up (assuming Word supports Thai) - and it's free! You can check it out here (http://www.anypdftools.com/pdf-to-word.html)

EDIT: Just tried it with a vectored PDF and what it gives you is an image of each page in Word, so whilst you cannot edit the text you can resize the image - which might give you what you want.

bthoven
04-01-2010, 12:45 AM
Cool.

By the way, if you want to cut out the "middle man", and just have ImageMagick do the resizing, you can use:

convert input.pdf -resize 600x800! output.pdf

The units for -resize are pixels, 1/72th of an inch. It'll do every page. The exclamation mark is needed if you want to lose the aspect ratio.

Very handy if put in a batch file to do an entire directory (or more) at once. Let me know if you'd need help with that. (I'd need to know your operating system.)

Wow! very handy command.

I've tried the command with my pdf file, it failed on the way. I believe it was because my original file has a number of different page sizes.

It worked if my pdf input file has consistent page size; or same page size for all pages.

Thanks again.

bthoven
04-01-2010, 12:52 AM
Have you tried AnyBizSoft PDF to Word converter. It says it supports Thai and presumably once it's in Word you could tidy it up (assuming Word supports Thai) - and it's free! You can check it out here (http://www.anypdftools.com/pdf-to-word.html)

EDIT: Just tried it with a vectored PDF and what it gives you is an image of each page in Word, so whilst you cannot edit the text you can resize the image - which might give you what you want.

Thanks for your suggestion, OCR for Thai language has progressed no where near acceptable; so I would totally ignore this technology.

Even converting a vectored pdf into Word for Thai text, the result is still not acceptable, too many errors to correct.

If I have a vectored PDF which page size is too big with too much text, I use sopdf to trim the margins, and if necessary, to split each page into two, and view it in landscape mode. I can live with this approach.