Java Mailing List Archive

http://www.junlu.com/

Google
Google
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
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
Inconsistency in PDF RTF and HTML

Inconsistency in PDF RTF and HTML

2006-08-09       - By Mark Storer

 Back
Reply:     1     2  

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>&nbsp;</DIV>
<DIV><SPAN class=302572321-09082006><FONT face="Courier New" size=2>The PDF can
be precise.&nbsp; That's what PDF is FOR.</FONT></SPAN></DIV>
<DIV><SPAN class=302572321-09082006><FONT face="Courier New"
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=302572321-09082006><FONT face="Courier New" size=2>HTML, on
the
other hand, varies widely.&nbsp; Different browsers display the same page in
different ways.&nbsp; Professional web designers spend long hours ironing out
all the stupid little differences between Firefox and IE and Safari and...&nbsp
;
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>&nbsp;</DIV>
<DIV><SPAN class=302572321-09082006><FONT face="Courier New" size=2>Don't
expect
them to look identical.&nbsp; I wouldn't even expect them to be all that
similar
from a tool like iText, using their high-level objects.&nbsp;
</FONT></SPAN></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=302572321-09082006><FONT face="Courier New" size=2>If you want
precision, stick to PDF.&nbsp; </FONT></SPAN></DIV>
<DIV><SPAN class=302572321-09082006><FONT face="Courier New"
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=302572321-09082006><FONT face="Courier New" size=2>This is
called "Managing Expectations".&nbsp; Don't expect HTML &amp; PDF &amp; RTF to
look the same.&nbsp; You'll be disappointed.&nbsp; 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>&nbsp;</DIV>
<DIV><SPAN class=302572321-09082006><FONT face="Courier New" size=2>Or you can
'fix it yourself'.&nbsp; I have.&nbsp; The wonders of Open
Source.</FONT></SPAN></DIV>
<P><FONT face=Arial size=2>--Mark Storer</FONT> <BR><FONT face=Arial
size=2>&nbsp; Senior Software Engineer</FONT> <BR><FONT face=Arial size=2>&nbsp
;
Cardiff Software</FONT> </P>
<P><FONT face=Arial size=2>#include &lt;disclaimer&gt;</FONT> <BR><FONT
face=Arial size=2>typedef std::Disclaimer&lt;Cardiff&gt; 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>&nbsp;</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>&nbsp;</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

©2008 junlu.com - Jax Systems, LLC, U.S.A.