I am still waiting for an answer. Does anyone know how to change the
width of the first column in the pdf when creating a pdf from html?
Rachel Kozlowski MS (CIS) MT (ASCP)
Software Engineer
p 734.669.7658
f 734.930.7611
Solucient, a Thomson business
[EMAIL PROTECTED]
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Kozlowski, Rachel (TH USA)
Sent: Wednesday, January 10, 2007 3:22 PM
To: [email protected]
Subject: Re: [iText-questions] HTML to PDF table problem
I accidently gave you all the wrong HTML. I still need a fix for this.
<HTML>
<HEAD>
</HEAD>
<BODY>
<P align="center"><U><B><FONT style="font-family: Arial; font-size:
10.0pt; ">Sub 10 Trending Report</FONT></B></U></P>
<TABLE BORDER="1">
<TR>
<TD align="left" style="line-height: 10.0pt;"><FONT
style="font-family: Arial; font-size: 10.0pt; ">
National Benchmark
</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; ">7.1%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >7.1%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >7.0%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >6.8%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >6.8%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >6.8%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >6.6%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >7.1%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >7.2%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >6.9%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >6.9%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >6.8%</FONT>
</TD>
</TR>
</TABLE>
<P align="center"><B><FONT style="font-family: Arial; font-size: 10.0pt;
">
<A
href="file:///U:/My%20Web%20Sites/primary_outcomes_reports_access.htm">P
rimary
Outcomes Report Access</A></FONT></B></P></BODY></HTML>
Rachel Kozlowski MS (CIS) MT (ASCP)
Software Engineer
p 734.669.7658
f 734.930.7611
Solucient, a Thomson business
[EMAIL PROTECTED]
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Kozlowski, Rachel (TH USA)
Sent: Wednesday, January 10, 2007 2:30 PM
To: [email protected]
Subject: [iText-questions] HTML to PDF table problem
Hi All:
Every time I create a pdf from html the first column of the
table takes up half the page even though the first column width is set
at 5%. I would like the first column to be about 5%. I have attempted
totally removing the width from the html. Any thoughts or suggestions
are appreciated.
I have attempted this using several tables. I have used the java code
(the html code is found below the java code:
/*
* $Id: Chap0706.java,v 1.5 2003/06/25 07:36:33 blowagie Exp $
* $Name: $
*
* This code is free software. It may only be copied or modified
* if you include the following copyright notice:
*
* --> Copyright 2001 by Bruno Lowagie <--
*
* This code is part of the 'iText Tutorial'.
* You can find the complete tutorial at the following address:
* http://www.lowagie.com/iText/tutorial/
*
* This code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* [email protected]
*/
import java.io.FileOutputStream;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import com.lowagie.text.Document;
import com.lowagie.text.PageSize;
import com.lowagie.text.pdf.PdfWriter;
import com.lowagie.text.html.SAXmyHtmlHandler;
public class Chap0706 {
public static void main(String[] args) {
System.out.println("Chapter 7 example 6: parsing the HTML from
example 2");
// step 1: creation of a document-object
Document document = new Document(PageSize.A4, 80, 50, 30, 65);
try {
// step 2:
// we create a writer that listens to the document
// and directs a XML-stream to a file
PdfWriter.getInstance(document, new
FileOutputStream("Chap0706.pdf"));
// step 3: we create a parser and set the document handler
SAXParser parser =
SAXParserFactory.newInstance().newSAXParser();
// step 4: we parse the document
parser.parse("sub_10_trending_report.htm", new
SAXmyHtmlHandler(document));
}
catch(Exception e) {
e.printStackTrace();
System.err.println(e.getMessage());
}
}
}
This is the html code example and is saved as
sub_10_trending_report.htm:
<HTML>
<HEAD>
</HEAD>
<BODY>
<P align="center"><U><B><FONT style="font-family: Arial; font-size:
10.0pt; ">Sub 10 Trending Report</FONT></B></U></P>
<TR>
<TD align="left" width="5%"><B><FONT style="font-family: Arial;
font-size: 10.0pt; " >National Benchmark</FONT></B>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; ">7.1%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >7.1%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >7.0%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >6.8%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >6.8%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >6.8%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >6.6%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >7.1%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >7.2%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >6.9%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >6.9%</FONT>
</TD>
<TD align="right"><FONT style="font-family: Arial; font-size:
10.0pt; " >6.8%</FONT>
</TD>
</TR>
</TABLE>
<P align="center"><B><FONT style="font-family: Arial; font-size: 10.0pt;
">
<A href="file:///U:/My%20Web%20Sites/primary_outcomes_reports_access.htm
<file:///U:\My%20Web%20Sites\primary_outcomes_reports_access.htm>
">Primary
Outcomes Report Access</A></FONT></B></P></BODY></HTML>
Rachel Kozlowski MS (CIS) MT (ASCP)
Software Engineer
p 734.669.7658
f 734.930.7611
Solucient, a Thomson business
[EMAIL PROTECTED]
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/