Q:
Thanks for the pointers to create watermark pdf. I'm unable to find an
example for web, as all the samples are available for console
applications.
1. We donot want the generated pdf to be physically created in the
server (i.e we donot want to call PDFDoc.save("location"), rather we
want to read the bytes and render as pdf on the fly. Is it possible to
do that. If so, kindly provide us a sample for the same.
--------------------
A:
Most of PDFNet samples can also be used in web setting. In case you
would like to save the resulting document in memory you would simply
use the overloaded doc.Save() method.
For example:
// C#
byte[] buf = new byte[1];
int buf_sz = 1;
doc.Save(ref buf, ref buf_sz, SDFDoc.SaveOptions.e_remove_unused);
//
VB.NET
Dim buf(0) As Byte
Dim buf_sz As Integer = 1
doc.Save(buf, buf_sz, SDF.SDFDoc.SaveOptions.e_remove_unused)
// JAVA
byte[] buf = doc.save(SDFDoc.e_remove_unused, null);
// C++
const char* buf = 0;
size_t buf_sz;
doc.Save(buf, buf_sz, SDFDoc::e_remove_unused, NULL);
// PYTHON
buffer = doc.Save(SDFDoc.e_remove_unused)
... etc
For a concrete sample project please see PDFDocMemory sample:
http://www.pdftron.com/pdfnet/samplecode.html#PDFDocMemory