Hi,
I am using iTextSharp vs 5.2.1 to generate very simple, text based pdfs.
The code I am using works perfectly to generate and position the text,
with one catch.
Code (Works, PDF is ok): [pd is pdfcontentbyte and cp is a custom
class with text properties]
it.Document itd = new iTextSharp.text.Document();
itd.SetPageSize(new it.Rectangle(0,0,792, 612));
itd.SetMargins(0, 0, 0, 0);
itd.SetMarginMirroring(true);
*** itd.Add(new it.Chunk(" ", helvFont));
pd.BeginText();
pd.SetFontAndSize(cp.bfont, cp.size);
pd.ShowTextAligned(it.Element.ALIGN_LEFT, s, x +
cp.spaceBefore, y + cp.baselineShift, 0);
pd.EndText();
If I remove the starred line (adding the chunk), the pdf generates,
but will not display in acrobat ("Could not acquire page").
I've looked through iText in Action several times and can't see
anything missing, is there something that gets initialized with a
high-level writer that I am missing with the low-level?
Thanks
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
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