How can I resize a PDF and keep a right blank margin
Re: How can I resize a PDF and keep a right blank margin
yes quality is higher, the PNG is now 2356x3333
Re: How can I resize a PDF and keep a right blank margin
Yes quality is higher. PNG file is now 2356x3333 dpi
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How can I resize a PDF and keep a right blank margin
Good. So now:
... should give you a right-margin.
If that works, try it in one step:
Code: Select all
convert myfile-*.png -page 2600x3333 r2.pdf
If that works, try it in one step:
Code: Select all
convert -density 300 mypdf.pdf -resize 95% -page 2600x3333 mynewpdf.pdf
snibgo's IM pages: im.snibgo.com
Re: How can I resize a PDF and keep a right blank margin
Thanks a lot Snibgo ! It works perfectly and I understood the way to do. But, there is another point, which is the final weight of the document. So I tried different densities to find the best compromise between quality and weight. (original PDF is 2MB, resized pdf - density 300 dpi: 155 MB, 150 dpi: 40 MB, 100 dpi: 18 MB). I know ImageMacker is not Acrobat, but no way to lighten the document without loosing quality ?
Re: How can I resize a PDF and keep a right blank margin
Just in case you are going this route to resize a PDF (via ImageMagick) as an "act of desperation" because...michellux wrote:I have a .pdf file to resize, for example 95%, and convert it in .jpg. That is working fine. But if I take my .jpg to transform it back in .pdf, the image is automaticaly resized to take all the width of the document.
- you are not aware of any other way to add an extra margin to the PDF pages (or to resize them),
- but you are not really interested (which you may nevertheless still be for some reason beyond my knowledge) to convert your PDF fonts/vectors to mince-meated (and either bad quality or big file size) full-page pixel graphics (it's just the price you pay for getting the resizing)...
Here is a method to get this done with Ghostscript:
1. First, create a demo PDF file with 2 pages (A4) 595 x 842 pt each, using Ghostscript:
Code: Select all
gs \
-o origin.pdf \
-sDEVICE=pdfwrite \
-g5950x8420 \
-c "1 0 0 setrgbcolor 0 0 595 842 rectfill \
1 setgray \
10 10 575 822 rectstroke \
/Helvetica findfont 36 scalefont setfont \
20 800 moveto \
(Page 1) show showpage
0 1 0 setrgbcolor \
0 0 595 842 rectfill \
1 setgray \
10 10 575 822 rectstroke \
20 800 moveto \
(Page 2) show showpage"
Code: Select all
gs \
-o temp-630x842pt.pdf \
-sDEVICE=pdfwrite \
-g6300x8420 \
origin.pdf
Code: Select all
gs \
-o rescaled.pdf \
-sDEVICE=pdfwrite \
-g5950x8420 \
-dPDFFitPage \
-f temp-630x842pt.pdf

On the left is the original page. In the center is the original page, placed on a page that is 630 pts wide. On the right is the original page as it appears after the page from the center image is scaled back to A4.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How can I resize a PDF and keep a right blank margin
I expect the method shown by pipitas keeps the filesize small, while retaining all the quality. This is because it does not not convert vectors into pixels.michellux wrote:I know ImageMacker is not Acrobat, but no way to lighten the document without loosing quality ?
For processing PDF files, Ghostscript is a more natural tool than ImageMagick.
snibgo's IM pages: im.snibgo.com
Re: How can I resize a PDF and keep a right blank margin
@ Snigbo : ok I understand better now. Thanks for all you did. 
@ Pipitas : Thanks. I still work on your solution. I cannot see the image you put in. I'll give my email in MP. Can you please send it to me ?

@ Pipitas : Thanks. I still work on your solution. I cannot see the image you put in. I'll give my email in MP. Can you please send it to me ?
Re: How can I resize a PDF and keep a right blank margin
Anybody else who cannot see the image?!?michellux wrote:I cannot see the image you put in.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How can I resize a PDF and keep a right blank margin
I see all three of your images that have been concatenated into one image and the final images shows fine for me. It might be a browser issue?
Re: How can I resize a PDF and keep a right blank margin
Yes, that's how it is supposed to be....fmw42 wrote:I see all three of your images that have been concatenated into one image
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How can I resize a PDF and keep a right blank margin
It shows fine for me. It can be downloaded from http://i.stack.imgur.com/o5mVu.png
snibgo's IM pages: im.snibgo.com
Re: How can I resize a PDF and keep a right blank margin
It is McAfee Web Gateway (used by my company) which blocked the URL. I asked the hotline to send me the file 

Re: How can I resize a PDF and keep a right blank margin
Maybe we should ask the ImageMagick developers if they could start to create a new '-metric pr0n' measurement method.
It would return a number in the range of {0..100} telling the probability in percent of an image being NSFW. McAffee could then make use of it and let pass all images which are below a threshold of, say, 10%...

It would return a number in the range of {0..100} telling the probability in percent of an image being NSFW. McAffee could then make use of it and let pass all images which are below a threshold of, say, 10%...

Re: How can I resize a PDF and keep a right blank margin
Sorry, but I really don't know Ghostscript. I downloaded and installed it, and Gsview too, but I really don't see how to do the 3 phases you describe ...
Re: How can I resize a PDF and keep a right blank margin
Why should I do Phase 1 "Creating demo.pdf" if in phase 2 I use my pdf file ?