I am doing a very basic html to pdf parser. Primarily it will be creating
from html tables.
I have a working prototype using JTidy.
The only problem I am having is the first cell in any table always takes up
50% of the table width. This is regardless of whether I set the cell widths
indivually or not.
Is this a known issue?
The html is :
<HTML><HEAD> <TITLE></TITLE> </HEAD>
<BODY>
<TABLE width='100.0%' cellpadding='1.0' cellspacing='1.0'
border='1.00' bordercolor='#0000ff'>
<TR>
<TD width='20.0%'>
<DIV style='line-height: 10.0pt;
font-family: Helvetica; font-size: 8.0pt; color: #004040;'>
<B>SSN</B>
</DIV>
</TD>
<TD width='20.0%'>
<DIV style='line-height: 10.0pt;
font-family: Helvetica; font-size: 8.0pt; color: #004040;'>
<B>First Name</B>
</DIV>
</TD>
<TD width='60.0%'>
<DIV style='line-height: 10.0pt; font-family:
Helvetica; font-size: 8.0pt; color: #004040;'>
<B>Last Name</B>
</DIV>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
The code is:
public static void main(String[] args) {
Document document = new Document(PageSize.A4.rotate());
try {
FileInputStream fis = new FileInputStream("test2.html");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PdfWriter.getInstance(document, new
FileOutputStream("test1.pdf"));
Tidy tidy = new Tidy();
tidy.setXHTML(true);
tidy.setTidyMark(false);
tidy.setMakeClean(true);
tidy.parse(fis, baos);
fis.close();
ByteArrayInputStream bais = new
ByteArrayInputStream(baos.toByteArray());
baos.close();
HtmlParser.parse(document, bais);
}
catch (Exception e) {
e.printStackTrace();
System.err.println(e.getMessage());
}
}
Jim Malloy
Enterprise Application Services
------------------------------------------------------------------------------
This e-mail transmission may contain information that is proprietary, privileged
and/or confidential and is intended exclusively for the person(s) to whom it is
addressed. Any use, copying, retention or disclosure by any person other than the
intended recipient or the intended recipient's designees is strictly prohibited. If
you are not the intended recipient or their designee, please notify the sender
immediately by return e-mail and delete all copies.
==============================================================================
-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions