Pdf generation by iTextSharp library
I am new to this forum and as well as new to use iTextPdf library for pdf genearation.
My domain is .Net.
Here is my problem.
I had followed an example which was give by iTextSharp tutorial.
The example is in Java and I converted it to .Net(C#).
Here is my code.
// step 1: creation of a document-object
Document document = new Document(iTextSharp.text.PageSize.A4);
// step 2:
// we create a writer that listens to the document
// and directs a PDF-stream to a file
PdfWriter.GetInstance(document, new FileStream("Chap0101.pdf", FileMode.Create));
// step 3: we open the document
//Font font = iTextSharp.text.FontFactory.GetFont("Calibri", 20);
// step 4: we add a paragraph to the document
document.Add(new Paragraph("Hello World"));
// step 5: we close the document
I am geetting the following error :
"The document has no pages." in PdfPages.cs
Kindly help me on this.....
I too got the same message, please help me /let me know if you get the answer. I could temporarily resolve this error by deleting the created pdf file after every executon, but i know that would not solve the problem,
Also, i need to convert immages in html to pdf, ccould you help me with this also?
My email is firstname.lastname@example.org
Noted that u commented out the "//document.NewPage();" line? does that work or not?
If not maybe theres some sort of property u need to set for a new page?
|All times are GMT. The time now is 06:16 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.