0

If you do a google search you will find some code samples more or less like this:

PdfWriter writer = PdfWriter.GetInstance(document, myIoStream);

And interestingly, most of the code samples don't use the writer object at all. So, what's the point of getting that handle? Thank you!

Stack0verflow
  • 1,091
  • 3
  • 17
  • 41

1 Answers1

2

You can do just PdfWriter.getInstance(document, myIoStream);

this will "create" the document using the stream.

When using PdfWriter writer = PdfWriter.GetInstance(document, myIoStream);

we can use a lot of methods like AddAnnotation() that will be merged with the document or also call .DirectContent to add images, etc.

Hope it helps.

Hugo S. Mendes
  • 1,046
  • 11
  • 22