Because iText does not handle conversion of html text, I have been using
HTMLdoc to convert html text stored in a database to PDF. This worked fine
for creating pdf representaions of individual data rows. I simply write the
data to an HTML file then use HTMLDoc to convert it to PDF.

I am now attempting to build a book of this data using Chapters, Paragraphs
and Sections. I've been able to build the outline of the book but now have a
problem. I need add the pdf to a Section. The following code adds the actual
html text to a Section.

                        String title = row.getData("SectionTitle").getString();

                        Paragraph pTitle = new Paragraph(title, sectionFont);

                        Section subsection = section.addSection(1,pTitle, 1);

                        // SectionInfo contains HTML text
                        if(!row.getData("SectionInfo").getString().trim().equals(""))
                        {
                                // This line adds the text but thats not what I really 
want
                                Section info = new 
Paragraph(row.getData("SectionInfo").getString());

                                // This is what I want to do
                                // This is where I would create a PDF Document out of 
the text
                                //
                                /*
                                        // I can create an htmlfile
                                        String filename = createHTMLFile(row);
                                        // I can convert it to a pdf  using HTMLDoc
                                        String pdfFile = toPDF(filename);
                                        // I can read the pdf
                                        PdfReader reader = new PdfReader(pdfFile);
                                        int n = reader.getNumberOfPages();
                                        int i = 0;
                                        while (i < n) {

                                                i++;
                                                PdfImportedPage page1 = 
writer.getImportedPage(reader,
i);

                                                // Here is where I stuck !!!!
                                                // How do I add the pages to the 
section?

                                        }
                                */


                        }
                        catch (Exception de) {
                                de.printStackTrace();
                        }

                        subsection.add(info);


Any suggestions would be appreciated.

Rich Ruiz
C3BGroup Inc.



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to