1

I'm looking for way to load an iTextSharp document from byte[] representing a PDF.

1 Answer 1

1

If b is a byte[] that represents a valid PDF file, then you can load the PDF into iTextSharp like this:

PdfReader reader = new PdfReader(b);

Now you can do all sorts of things with the reader object, such as copy pages using the PdfCopy class, stamp content on the PDF using PdfStamper, and so on.

Read Chapter 6 of my book to find out what you can (or can't) do with the PdfReader object. You'll need the full book if you want to extract text from the PDF. You should abandon hope if you assume that PDF is a format that is similar to Word.

All in all, your question is very broad. It isn't clear what you are asking. What do you mean by "load into an iTextSharp document"? If you are referring to the Document object, your question may be wrong as you typically won't use the Document object when manipulating existing PDFs, but you'll read all about that in the free chapter of my book.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.