[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


PDF to CSS conversion (converting generated CSS back to PDF must look exact!)

Posted on 2006-04-17
Medium Priority
Last Modified: 2012-06-27
I have looked at a lot of solutions out there and I had a few questions.

Here is my task:

I have a document that has been given to me in PDF format.  I cannot get the document in its original format it is only available in PDF.  I have to create the document in a CSS based webpage.  Then I have to take this CSS based webpage and convert it back to PDF, using Adobe Acrobat or SuperGoo.  Once converted back the this new PDF document must match the original that has been giving to me.  The client compares each document by printing both PDF forms and then holding them up to the light to see any differences.  If there are any, the document is rejected.

I can create the CSS correctly and have learned many advanced techniques.  The problem is when I convert back to PDF using Adobe Acrobat all my alignment for tables gets messed up.

My main question here is not automation as I know the degree of accuracy I am looking for is not attainable by an automated method.  My question is layout.  How to I found out what fonts and sizes were used for text in the original PDF?  How to I find out how big to make my starting "canvas" from the original PDF?  I am looking for a size to create my master table to base all other measurements off.

I have been using the measuring tool in Adobe Acrobat on the main document but cannot establish a good ratio to use (IE pixels to inches).

Any ideas are appreciated.

Question by:TelRiddler
1 Comment
LVL 17

Accepted Solution

mreuring earned 1500 total points
ID: 16476206
I hardly think any of us here have much of a clue about pdf to accurately predict how it will behave on the screen.

It's quite obvious you're between a rock and a hard place here. You're converting between a printer based document and screen based presentation. Now, oficially a 'screen' is 72 dpi where a printer is usually 300dpi or more. Altough is is generally no longer true for screens, they may vary a lot, most programs are still set up to assume 72 dpi. Fonts in PDF most likely are set to a pt value and this is again linked to the dots-per-inch, though most browsers will ink this to pixels with no variance as the screen gets bigger.

You're best best is starting to set up your document with the proper font-size and then setting up all the margins and what-not using 'em' as the unit-type. As this is relative to your font-size it might convert better to print or even pdf in this case. Although with no experience in accually doing this, it's only a suggestion based on my experience with print stylesheet...

Good luck,


Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
Suggested Courses
Course of the Month20 days, 4 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question