I'm using iTextSharp to update A PDF's file properties:
FileStream fs = File.Open(@"C:\Developer\C#Projects\BylawSearch\0001.pdf", FileMode.Open);
Document document = new Document();
PdfWriter writer = PdfWriter.GetInstance(document, fs);
document.Open();
document.AddSubject("Blah");
document.AddTitle("Blah blah");
document.AddKeywords("Blah blah blah");
document.Close();
I'm getting a "The document has no pages." error from iTextSharp. Any help appreciated.
You haven't added any information to put on a page ... !!
document.Add(new Paragraph("Hello World!"));
... for example.
Your title etc are part of the document properties (rather than something that's "printed" to the pdf).
Check out this introductory example, that seems to cover what you're after.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With