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

Posted on 2006-04-17
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

    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,


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    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... …
    So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
    In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
    In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now