Convert to/from stream


I’m investigating to use PDFTron to handle file conversions and have some questions. I’m working with dotnet core using C#. Currently the way our system is setup is that we get a Stream as input and want to save a pdf back to a Stream.

For normal pdfs I noticed new PDFDoc() accepts a Stream and in PDFDoc.Save() I can also give a Stream, which is exactly what I need.
The problem I’m having is with other file types. For example when I have an office file I use pdftron.PDF.Convert.OfficeToPDF(), but this one only accepts a string that points to a file somewhere on disk instead of a Stream.
Same with PDFDraw(), it has a function called Export(), but I cannot find a way to use it to output it as a Stream the same way PDFDoc.Save() can.

Is this possible with pdftron?

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:



It is possible to convert office files from a stream/filter. Instead of the method that takes a string to a filepath, we also offer an API that takes a filter. Please see the link here for the OfficeToPDF API.

In addition, PDFDraw has a GetBitmap method, that exports the image into a Bitmap that you can save in memory.

Please let me know if this works for you, and if you have any further questions.

Hi shakthi124,

Thanks for your reply, I’ve managed to get everything working the way I wanted.