Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Convert PDF document to image file

PHP, Imagemagick, PDF



8:23 am on Jan 16, 2013 (gmt 0)

10+ Year Member

Good morning world,

I need to convert a PDF document to an image file. I have ImageMagick and convert-function which partly solves my problem.
Specifically, I need to get converted into a PDF document to an image file, so the aspect ratio is 1:1. This means that if I open the PDF document in a browser (eg. Chrome and with 100% zoom) and open the image file, so they must be completely identical.
It has not managed to find the right "recipe" yet.

I hope there is a kind soul who can help me.



9:29 am on Jan 16, 2013 (gmt 0)

WebmasterWorld Senior Member swa66 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

You're asking for orange flavored apples I'm afraid.

PDF contains pages of a certain size (A4, US, ...) intended to be printed - but they can be previewed on a a screen as well. PDFs contains essentially vector information (they can contain images as well in various resolutions). You can zoom in and out of pdf files at will, and you need to zoom in extremely deep to see the "resolution" of any well made file (images in the file will show their resolution first, but fonts, lines etc will not do so easily.

images are about pixels.

If you want both to be the same "size" well you need to first define the size of the pdf and having it as "full screen" just isn't going to work everywhere as it'll depend on the size of the specific screen.


9:44 am on Jan 16, 2013 (gmt 0)

10+ Year Member

Aw, it was not exactly the answer I expected ;-)

My problem is that I need a draggable DIV into a PDF document. When this DIV released, I get top / left coordinates. The coordinates will be used to make a similar box/border/square in the same PDF document, with for example FPDF.

So I thought that if I could make draggable DIV on the image file size 1:1, so I had solved the problem. But when I can not make the image file 1:1, so I have a new problem. Damn.


3:05 pm on Jan 16, 2013 (gmt 0)

WebmasterWorld Senior Member swa66 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

From what I understand you're trying to make a system to paste a pdf page into / on top of an existing pdf document ?

Both the pdf documents have sizes in them. But don't you need to give users a way to scale what you paste ?


8:44 am on Jan 17, 2013 (gmt 0)

10+ Year Member

I have an existing PDF document.
Users must be able to insert a frame / box (with text inside) on top of the existing PDF document.
I can insert box in the PDF document. But my problem is that I can not make a system so that users can decide (using the mouse) where the box will be placed.

That's why I began to think in other terms, in terms of having an image where users with a draggable DIV can specify the location of the PDF document. The image file should of course reflect PDF 1:1.

Do you understand my problem?


2:24 pm on Jan 22, 2013 (gmt 0)

In case you need other type of PDF conversions, I warmly suggest this website: http://kitpdf.com/. It exports web pages onto PDF files and also convert from PDF to text, mobi or epub for your ebook readers. Enjoy.

[edited by: coopster at 8:16 pm (utc) on Jan 24, 2013]
[edit reason] delinked url [/edit]


Featured Threads

Hot Threads This Week

Hot Threads This Month