Q:
We are storing our documents in a SQL Blob column (then reading them into either a byte array or memory stream) and need to convert them to a PDF and would like to do this without having to create a disk file in the middle.
As of PDFNet v.5.9 'pdftron.PDF.Convert.ToPdf()' methods support only conversion via filename. This means that you would need to save a file to a temp file for conversion. The converted PDF files does need to be saved to disk however (PDFDoc.Save() method can be used to save to byte[] or a Stream).
Please note that some conversions such as Html2Pdf (for HTML, TXT), Image (Jpeg, TIFF, png, gif, etc see AddImage sample), XPS, Xaml, EMF/WMF, PDF do support conversion from a memory buffer or a stream so it is not always the case that you need to save the input file.
Ø can you provide us with a list of the document types that can be converted to a PDF
|
Type |
Extension |
|
PDF and PDF/A |
|
|
XPS |
XPS, OXPS, XOD |
|
Web Pages |
HTM, HTML, MHT, MHTM, MHTML, SHTM, SHTML, XHTML |
|
Plain Text |
TXT, REG, BAT, INI, LOG, CONF, INF, XML, XSL, XSLT, XSD, JS, CSS, PHP, ASP, ASPX, JSP, SH, VB, VBS |
|
Source Code with Syntax Highlighting |
C, CC, CPP, H, HH, HPP, CS, JAVA |
|
Raster Images |
BMP, ICO, GIF, JPG, JPEG, PNG, TIF, TIFF |
|
Vector Images |
EMF, WMF, SVG (via HTML2PDF), XAML |
|
Microsoft Word |
DOC, DOCM, DOCX, DOT, DOTM, DOTX * |
|
Microsoft Powerpoint |
POT, POTM, POTX, PPA, PPAM, PPS, PPSM, PPSX, PPT, PPTM, PPTX * |
|
Microsoft Publisher |
PUB * |
|
Microsoft Excel |
XLA, XLAM, XLC, XLL, XLM, XLS, XLSB, XLSM, XLSX, XLT, XLTM, XLTX, XLW * |