PDFNet document creation options for PDF and XOD.

Q: I have a few questions regarding your PDFNet and WebViewer product.

I would like to dynamically generate PDF (or XOD) and would also like to be able to add new content (e.g. stamps, headers, watermarks, etc) to existing pages. What are my options?

A: Yes, using PDFNet you have much more control over conversion and
document generation process compared to DocPub. Since you are dealing
with text data, you can also use any other PDF generation utility or
library to convert text to PDF.

With PDFNet there are many ways to generate a document (or add new
content to existing documents). For example,

  1. If you are developing using .NET you could use native DotNet
    Framework APIs such as FlowDocument or XAML to generate dynamic
    content containing text, images, and vector art. This approach is
    illustrated in Xaml2Pdf sample (http://www.pdftron.com/pdfnet/

  2. You could use ElementBuilder and ElementWriter (http://
    www.pdftron.com/pdfnet/samplecode.html#ElementBuilder) as show in to
    programmatically generate any type of PDF. These classes are quite
    powerful but are relatively low-level. For an example of how these
    classes can be used to programmatically generate a document out of
    text content please see http://pdfnet-sdk.googlegroups.com/web/Text2PDF.zip.doc
    (you should save the file with “zip” extension).

  3. You could also generate a PDF/XPS/Silverlight document using
    ‘System.Drawing.Graphics’ as shown in PDFDC (http://www.pdftron.com/
    pdfnet/samplecode.html#PDFDC) sample. This approach can be useful is
    you have an existing code that is already drawing on a Graphics object
    (e.g. to display content on screen or for printing). In this case you
    can use the same code without major changes to output to PDF, XPS,
    SVG, or Silverlight.

  4. The latest version of PDFNet also offers document generation from
    HTML. This approach is illustrated in HTML2PDF sample (http://
    www.pdftron.com/pdfnet/samplecode.html#HTML2PDF). The HTML content can
    be stored in a string or referenced via URL.

  5. You can also directly convert from a number of other formats (e.g.
    XPS, EMG, TIFF, JPEG, MS Office) to PDF using ‘pdftron.Convert’ API as
    shown in Convert sample (http://www.pdftron.com/pdfnet/
    samplecode.html#Convert). File formats that can be directly converted
    to PDF are printed via a virtual printer driver. This is probably the
    least preferable way to generate PDF on the server side but in some
    cases it can be fairly effective.

I also noticed a significant file size increase due to the overhead behind the .xod
file compared to the .txt file so I may need to think of another way to display them.

It is normal that PDF, XPS, Silverlight XOD are larger than the source
text file (.txt). These documents include fonts, exact positioning
information, color profiles etc. In some cases you can reduce the
resulting file size using pdftron.PDF.Optimizer (as shown in PDF
optimizer sample - http://www.pdftron.com/pdfnet/samplecode.html#Optimizer).

If I have a user that calls the SilverDox program hosted at www.myinternetdomain.com/DocumentReader.aspx,
can they pull up .xod documents that are located within their local intranet environment

Yes, this is definitely possible. We have just released a new version
of SilverDox (v.1.1) that offers on the fly conversion from PDF and
XSP to Silverlight. For more information please see:
http://www.pdftron.com/silverdox/whatsnew.html and download the new
version from:

http://www.pdftron.com/silverdox/downloads.html and