Q: I must be just missing it, but I can't find a version of the
method that just deals with memory. After I finish manipulating a
instance, I just want to get the raw data file to save in a database.
the save method signature that writes to a file (and sadly, I'm
writing it to a temporary file, then reading the file, then deleting
but I'm assuming you have a version to write to memory. I even see a
signature in the documentation that I have that I can't see in .NET
intellisense that seems to pass around buffers.
How do I just take a PDFDoc and write the PDF that it represents to
A: Unfortunately intellisense sometimes does not work reliably.
You can use a version of pdfdoc.Save(...) method that can save to a
memory buffer. For a concrete example please take a look at
PDFDocMemory sample project (http://www.pdftron.com/pdfnet/
You can serialize PDFDoc to memory as shown in PDFDocMemory sample
project (http://www.pdftron.com/net/samplecode.html#PDFDocMemory). For
// In C#:
byte buf = new byte;
int buf_sz = 1;
doc.Save(ref buf, ref buf_sz,
// In JAVA
byte buf=doc.save(SDFDoc.e_linearized, null);
// In C++
const char* buf = 0;
doc.Save(buf, buf_sz, pdftron::SDF::SDFDoc::e_linearized, 0);