Q: I need to background print pdf’s that are already created. In
addition I need to create them as well. I use c# to develop web
pages. I need to be able to support creating and printing (background
printing also) of multiple pdf’s through code.
Also are there any other objects like grids or charts?
A: You can silently print PDFs as shown in PDFPrint sample project:
Using PDFNet there are multiple ways to generate PDF content from
a) Since you are developing in C# you could use WPF 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). The
advantage of this approach is that you can also use various third
party libraries (such as WPF charting, graphing, components etc.).
b) You could use PDFNet API to generate or add new content.
Specifically pdftron.PDF.ElementBuilder/ElementWriter are quite
powerful but are relatively low-level. For an example of how to use
this API please see ElementBuilder sample (http://www.pdftron.com/
c) 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.
d) You could generate PDF content from HTML. This approach is
illustrated in HTML2PDF sample (http://www.pdftron.com/pdfnet/
samplecode.html#HTML2PDF). The HTML content can be loaded from a
string or a URL.
e) You can also generate PDF 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.