How to: offset PDF content or embed and reposition PDF

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
jonathanjohnson100
Posts: 7
Joined: 2014-05-04T18:43:18-07:00
Authentication code: 6789

How to: offset PDF content or embed and reposition PDF

Post by jonathanjohnson100 »

I have a PDF. The content is on the top left quadrant.
I want to print on the top right quadrant.
How do I do this?

Can I use ImageMagick to do this somehow? I wasn't 100% sure, I thought I would ask anyway.

I thought the best way was to make an image from the PDF. And then I can use something else to make a document with image embedded. This works OK, I got a great answer to my last post here.

But... results are poor - there is text which is small font in the content.
The text loses it's sharpness when made into an image.
It's only recently dawned on me why this is - because the text is text in the PDF and not part of a graphic!

2 solutions:

1. Printing output with offset (and scaling) - so output could be another PDF for example.

Or

2. Embedding PDF and keeping as PDF, into another document - importantly, then being able to scale & re-position.

Can I use ImageMagick to solve my problem?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to: offset PDF content or embed and reposition PDF

Post by fmw42 »

I am not really sure what you are trying to do. Could you post and example input PDF and describe in relation to the PDF what you want to do.

I will point out that ImageMagick is not a vector to vector processor. It will rasterize your PDF and then put that raster result back into a PDF shell. So essentially you can not keep vector text.

You can do that and try to preserve some quality if you rasterize and very high density and then resize the image down to your working pixel size. For example

convert -density 288 image.pdf -resize 25% new image.pdf

Note that nominal pdf density is 72. So 4*72=288 and that is why I resize by 1/4=25%

You can increase the density even further and resize to any amount you want. But the final PDF will no longer have vector text. Text will have been rasterized.

Please always provide your ImageMagick version and platform.
Post Reply