Did you see the various samples, like
Issue to PDF file
Good day,
Is there one better example to create PDF file? I used code below and PDF file then is empty (cannot be opened).
PdfWriter pdfWriter = new PdfWriter("f:\l0\A0.pdf");
PdfDocument pdfD0 = new PdfDocument(pdfWriter);
Document D0 = new Document(pdfD0);
9 additional answers
Sort by: Most helpful
-
Peter_1985 2,731 Reputation points
2020-10-26T15:35:27.173+00:00 Thanks to all.
Is there example/details to put text at specific position within PDF file? And example to create rectangle in that. -
Peter_1985 2,731 Reputation points
2020-10-31T14:26:08.783+00:00 Thanks a lot.
Last issue is, what should be the size same as one A4 paper size? How to adjust the following to have A4 paper size?Document D0 = new Document(pdfD0, new PageSize(900f, 670f));
-
Peter_1985 2,731 Reputation points
2020-11-09T10:17:05.15+00:00 Sorry, other than the following, is there one full example to do update into every position of the page?
Document D0 = new Document(pdfD0, PageSize.A4); D0.SetMargins(40, 40, 40, 40); Paragraph paragraph = new Paragraph(new Text("testing b\n")); paragraph.SetFixedPosition(10, 50, 210); paragraph.SetBorder(new iText.Layout.Borders.SolidBorder(2)); D0.Add(paragraph);
-
Peter_1985 2,731 Reputation points
2020-12-04T08:42:16.223+00:00 Sir,
Can you see this if available?