Creating PDFDoc with remote file

Product: PDFTron SDK for Python

Product Version: PDFNetPython3==9.1.0

Please give a brief summary of your issue:

I have a situation where the file I would like to create a new PDFDoc from is not on the server where the script lives. I have access to the file to read it into a buffer but am having some difficulty as I continue to receive the error:

TypeError: Wrong number or type of arguments for overloaded function ‘new_PDFDoc’.
Possible C/C++ prototypes are:
pdftron::PDF::PDFDoc::PDFDoc(pdftron::SDF::SDFDoc &)
pdftron::PDF::PDFDoc::PDFDoc(pdftron::PDF::PDFDoc const &)
pdftron::PDF::PDFDoc::PDFDoc(pdftron::UString const &)
pdftron::PDF::PDFDoc::PDFDoc(char const *)
pdftron::PDF::PDFDoc::PDFDoc(pdftron::UChar const *,size_t)

How can I go about creating a PDFDoc object from a buffer, without the need to create a temporary copy of it where this script is running?

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:


1 Like

The following post shows how to get a byte array from a PDF file, then open the PDF from the byte array, using PDFDoc(pdftron::UChar const *,size_t):