PDFNet document creation options for PDF and XOD.

467 views
Skip to first unread message

Support

unread,
Jan 5, 2015, 2:12:23 PM1/5/15
to
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/
samplecode.html#Xaml2Pdf
).

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
  http://www.pdftron.com/pdfnet/downloads.html

Support

unread,
Jan 5, 2015, 2:08:28 PM1/5/15
to

Besides ElementBuilder/Writer another cross-platfrom option to add new content to existing PDF pages is with 

6) pdftron.PDF.Stamper: www.pdftron.com/pdfnet/samplecode.html#Stamper.  Stamper is simpler to use but less flexible as low-levelElementBuilder 

7) by creating a temp PDF using any PDF generation option at your disposal and placing the content on top of existing PDF page(s) as shown in ImpositionTest sample: http://www.pdftron.com/pdfnet/samplecode.html#Imposition


Reply all
Reply to author
Forward
0 new messages