I'm pretty sure I'm missing something simple, but since I've been breaking
my head on this for a while, I'm just going to ask.
I'm using JavaScript to access the iText library to take a filable PDF and
serve it up via a browser. The process has worked for my first one, and
now I'm doing one where the original fillable PDF has 2 pages. I've been
trying to get the second page for a while now. I'm using the
PdfContentByte to get it to the browser, and it works except I can't seem
to get the PdfContentByte to have a second page. My relevant code is
below. When I add the second template (page2) they way I do, it moves what
I'm writing, but I'm still just getting one (US letter) page.
This my not be the most efficient code, but like I said, I've been trying
a few things on this. If someone has a pointer, I would be very grateful.
Cheers,
Brian
var cb:com.itextpdf.text.pdf.PdfContentByte = writer.getDirectContent();
var cb2:com.itextpdf.text.pdf.PdfContentByte = writer.getDirectContent();
var reader2:com.itextpdf.text.pdf.PdfReader = new
com.itextpdf.text.pdf.PdfReader(os.toByteArray());
var page:com.itextpdf.text.pdf.PdfImportedPage =
writer.getImportedPage(reader2, 1);
cb.addTemplate(page, 0, 0); //this works as expected
var page2:com.itextpdf.text.pdf.PdfImportedPage =
writer.getImportedPage(reader2, 2);
cb2.addTemplate(page2, 0, 100); //this will add, and with the 100 do an
offset, but the "physical size" of the paper is the same
Brian Moore
------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php