Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6577949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:42:23+00:00 2026-05-25T15:42:23+00:00

I have document source in XML. I need to generate PDF and HTML pages

  • 0

I have document source in XML.
I need to generate PDF and HTML pages from it, and the problem is HTML and PDF copies should look exactly the same (if in PDF dcument on 2nd page, the first word in 3rd row is “computer”, then in HTML it has to be the same). Also I need to print out this document from web browser and page layout should also be the same.

I need advise, what tools to use and how better realize this solution.
Also it is preferrable to do this with PHP/javascript, not java…


Margins, font sizes may be different, I just need to make position of words absolutely the same in all copies. The document format is quite simple, it looks like a book.

I was thinking to generate PDF first and then show it in web-browser and use it for printing, but I’m

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:42:23+00:00Added an answer on May 25, 2026 at 3:42 pm

    You’ll never get identical PDF and HTML copies as you must generally go via a rendering engine and, as we know from using different browsers and operating systems, rendering engines often don’t render equal code equally.

    Similarly, when a user prints a page, the page is re-rendered as a ‘print’ layout; it doesn’t use the regular stylesheet, unless we set media="all". But even then, there are differences to the printed version:

    … most browsers are configured not to print backgrounds; and pixel-based fonts,
    while nice for screen media, are not so useful in print media.

    So unless your styling is very simple, you won’t get similar print/browser views. Even if the styling is simple, that’s all you’ll get: similarity, not an identical page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML document from an external source. <?xml version=1.0 encoding=utf-8?> <ns0:Info xmlns:ns0=http://www.ZomboCorp.com/>
Have a source xml document that uses namespace containing prefixes and a default namespace.
I need to generate a number of XML documents from Java objects. The objects
This is a snippet of text from the source xml document: Great Lakes. The
I need to transform one XML document into another using XSLT (for now from
I have a class that unmarshals xml from a 3rd party source (I have
I am currently starting using doxygen to document my source code. I have notice
Basically I have a script that updates an xml document in various places... However,
I need to pre-produce a million or two PDF files from a simple template
I have an XML document (an InfoPath form) that looks similar to this: <my:ClientMaintenance

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.