  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | JSP - A mailing list about Java Server Pages specification and reference | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Inconsistency in PDF RTF and HTML | Inconsistency in PDF RTF and HTML 2006-08-09 - By Mark Storer
Back Sadly, Consistent display isn't a reasonable expectation. The PDF can be precise. That's what PDF is FOR. HTML, on the other hand, varies widely. Different browsers display the same page in different ways. Professional web designers spend long hours ironing out all the stupid little differences between Firefox and IE and Safari and... Why do you think 'Flash' sites are becoming popular? Don't expect them to look identical. I wouldn't even expect them to be all that similar from a tool like iText, using their high-level objects. If you want precision, stick to PDF. This is called "Managing Expectations". Don't expect HTML & PDF & RTF to look the same. You'll be disappointed. A disappointed customer is an unhappy customer... but when you're consuming something freely given, you have to allow for different sets of priorities. Or you can 'fix it yourself'. I have. The wonders of Open Source.
--Mark Storer Senior Software Engineer Cardiff Software
#include <disclaimer> typedef std::Disclaimer<Cardiff> DisCard;
-- --Original Message-- -- From: itext-questions-bounces@(protected) [mailto:itext-questions -bounces@(protected)]On Behalf Of Michael Gantman Sent: Wednesday, August 09, 2006 2:20 AM To: itext-questions@(protected) Subject: [iText-questions] Inconsistency in PDF RTF and HTML
Hello. I have created a Document in iText and registed it with PDF, RTF and HTML writers. For some reason the resultant PDF RTF and HTML files look very inconsistent. PDF file actually looks as expected. HTML file doesn't display any changes that were made for borders i.e. if I set a border of a particular cell a 7 point thick and set it to a particular color it is not reflected in HTML. RTF has the same problem as HTML, plus in addition it does not show any images that were added to some cells. I was hoping to use iText to create uniformed docs in PDF RTF and HTML but it looks not too promising. Is there anything I can do to make docs look the same? At the moment I try to immitate an existing HTML with CSS as a proof of concept. but I build my document from scratch not using CSS available. Is it possible to create a Document using CSS? I saw the email on this list refering to class HTMLWorker. Can someone provide a sample how to do this? Or may be there is a way to convert existing HTML + CSS file into PDF and RTF files. Attached are the tree files that are produced from the same Document and show the inconsistencies described above. Also I found a small bug. If I add an Image into chunk and then set of chunks into Paragraph and then add Paragraph into cell which has bottom allignment and bottom border set to 7 and padding set to 3, the cell ignores thickness of the border and calculates padding is if border had thickness 1. So the images overlap with the border. Best regards, Michael Gantman
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR></HEAD> <BODY> <DIV><SPAN class=302572321-09082006><FONT face="Courier New" size=2>Sadly, Consistent display isn't a reasonable expectation.</FONT></SPAN></DIV> <DIV><SPAN class=302572321-09082006><FONT face="Courier New" size=2></FONT></SPAN> </DIV> <DIV><SPAN class=302572321-09082006><FONT face="Courier New" size=2>The PDF can be precise. That's what PDF is FOR.</FONT></SPAN></DIV> <DIV><SPAN class=302572321-09082006><FONT face="Courier New" size=2></FONT></SPAN> </DIV> <DIV><SPAN class=302572321-09082006><FONT face="Courier New" size=2>HTML, on the other hand, varies widely. Different browsers display the same page in different ways. Professional web designers spend long hours ironing out all the stupid little differences between Firefox and IE and Safari and...  ; Why do you think 'Flash' sites are becoming popular?</FONT></SPAN></DIV> <DIV><SPAN class=302572321-09082006><FONT face="Courier New" size=2></FONT></SPAN> </DIV> <DIV><SPAN class=302572321-09082006><FONT face="Courier New" size=2>Don't expect them to look identical. I wouldn't even expect them to be all that similar from a tool like iText, using their high-level objects. </FONT></SPAN></DIV> <DIV><FONT face="Courier New" size=2></FONT> </DIV> <DIV><SPAN class=302572321-09082006><FONT face="Courier New" size=2>If you want precision, stick to PDF. </FONT></SPAN></DIV> <DIV><SPAN class=302572321-09082006><FONT face="Courier New" size=2></FONT></SPAN> </DIV> <DIV><SPAN class=302572321-09082006><FONT face="Courier New" size=2>This is called "Managing Expectations". Don't expect HTML & PDF & RTF to look the same. You'll be disappointed. A disappointed customer is an unhappy customer... but when you're consuming something freely given, you have to allow for different sets of priorities.</FONT></SPAN></DIV> <DIV><SPAN class=302572321-09082006><FONT face="Courier New" size=2></FONT></SPAN> </DIV> <DIV><SPAN class=302572321-09082006><FONT face="Courier New" size=2>Or you can 'fix it yourself'. I have. The wonders of Open Source.</FONT></SPAN></DIV> <P><FONT face=Arial size=2>--Mark Storer</FONT> <BR><FONT face=Arial size=2> Senior Software Engineer</FONT> <BR><FONT face=Arial size=2>  ; Cardiff Software</FONT> </P> <P><FONT face=Arial size=2>#include <disclaimer></FONT> <BR><FONT face=Arial size=2>typedef std::Disclaimer<Cardiff> DisCard;</FONT> </P> <BLOCKQUOTE dir=ltr style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma size=2>-- --Original Message-- --<BR><B>From:</B> itext-questions-bounces@(protected) [mailto:itext-questions-bounces@(protected)]<B>On Behalf Of </B>Michael Gantman<BR><B>Sent:</B> Wednesday, August 09, 2006 2:20 AM<BR><B>To:</B> itext-questions@(protected)<BR><B>Subject:</B> [iText-questions] Inconsistency in PDF RTF and HTML<BR><BR></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN class=475564408-09082006>Hello.</SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN class=475564408-09082006>I have created a Document in iText and registed it with PDF, RTF and HTML writers. For some reason the resultant PDF RTF and HTML files look very inconsistent. PDF file actually looks as expected. HTML file doesn't display any changes that were made for borders i.e. if I set a border of a particular cell a 7 point thick and set it to a particular color it is not reflected in HTML. RTF has the same problem as HTML, plus in addition it does not show any images that were added to some cells. I was hoping to use iText to create uniformed docs in PDF RTF and HTML but it looks not too promising. Is there anything I can do to make docs look the same? At the moment I try to immitate an existing HTML with CSS as a proof of concept. but I build my document from scratch not using CSS available. Is it possible to create a Document using CSS? I saw the email on this list refering to class HTMLWorker. Can someone provide a sample how to do this? Or may be there is a way to convert existing HTML + CSS file into PDF and RTF files. Attached are the tree files that are produced from the same Document and show the inconsistencies described above.</SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN class=475564408-09082006></SPAN></FONT> </DIV> <DIV><FONT face=Arial size=2><SPAN class=475564408-09082006>Also I found a small bug. If I add an Image into chunk and then set of chunks into Paragraph and then add Paragraph into cell which has bottom allignment and bottom border set to 7 and padding set to 3, the cell ignores thickness of the border and calculates padding is if border had thickness 1. So the images overlap with the border.</SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN class=475564408-09082006></SPAN></FONT> </DIV> <DIV><FONT face=Arial size=2><SPAN class=475564408-09082006>Best regards,</SPAN></FONT></DIV> <DIV><FONT face=Arial size=2><SPAN class=475564408-09082006>Michael Gantman</SPAN></FONT></DIV></BLOCKQUOTE></BODY></HTML>
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 __ ____ ____ ____ ____ ____ ____ ____ ____ ____ iText-questions mailing list iText-questions@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions
|
|
 |