How to create a white A4 rect/pdf page

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
lynx_abraxas

How to create a white A4 rect/pdf page

Post by lynx_abraxas »

Hello!


I'm wondering how I can create a white A4 pdf page or further I'd like to extend an image with white borders to fill a A4 page. I tried:

Code: Select all

convert -page A4 xc:white white.pdf
but all I get is a single white pixel. The -page-option seems to be the only one that accepts page-sizes like A4.
How would I get it in landscape orientation?

Many thanks for answers
Lynx
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to create a white A4 rect/pdf page

Post by anthony »

I think you may be using the wrong tool. PDF is a vector image format. ImageMagick works with raster images.
A word about Vector Image formats
http://www.imagemagick.org/Usage/formats/#vector
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
lynx_abraxas

Re: How to create a white A4 rect/pdf page

Post by lynx_abraxas »

Well, as far as I know PDF can handle both raster and vector. The thing is imagemagick can put raster images into PDFs (many examples in the net) but if I look at these PDFs they are not at all A4 size. Independen of PDF I'd like to know how I can create a rectangle or extend a pic (fileformat supporting dpi values; eg svg) such that it would have A4 dimensions.
Of course it would be much better to have a PDF of A4 size and a white background without achieving this with lots of white pixels;)
I'm wondering what the option -page A4 is doing and what it is ment for if not for this purpose.
lynx_abraxas

Re: How to create a white A4 rect/pdf page

Post by lynx_abraxas »

Code: Select all

convert -page A4 rose: white.pdf       #-page A4 has no effect here
convert -page A4 white.pdf white2.pdf  #but here it has !?!
Is this a feature or a bug?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to create a white A4 rect/pdf page

Post by fmw42 »

try

convert rose: -gravity center -page A4 rose_A4.pdf

or get the pixel size from http://www.imagemagick.org/script/comma ... s.php#page

then

convert rose: -resize 595x842 -gravity center -page A4 rose_resize_A4.pdf
lynx_abraxas

Re: How to create a white A4 rect/pdf page

Post by lynx_abraxas »

Hm, I tried but both Your examples don't yield an A4 pdf for me.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to create a white A4 rect/pdf page

Post by fmw42 »

what version of IM are you using? if old, then perhaps you need to upgrade
Post Reply