MIME contents

Start page  Previous page  Next page

 

n2pdf includes a function for the processing of MIME contents (mime parts) which may be present in Notes documents or individual Rich Text fields. You can control the manner of processing here using various options.

 

The MIME contents generally occur in e-mail documents which are received via the Internet. The content of these documents is generally stored as HTML code in the MIME contents. Because n2pdf cannot work directly with this HTML content, but only with Rich Text content (based on the Notes CD records), this content must be converted.

 

This takes place, for example, when a Notes document based on MIME content is opened and saved in the Notes Client. The content is converted to Rich Text content by the Notes Client at this point in time. However, if this conversion has not taken place for a given MIME content, then the display of this document by n2pdf is often not clean.

 

To attain an improved display quality nonetheless, n2pdf now also offers a direct (automatic) option for conversion of the HTML content to Rich Text. If this conversion is used, then the document does not need to be converted by the Notes Client beforehand.

 

All the settings are made using the function N2PDFSetOption and must be made before the command for adding the respective content (e.g. N2PDFAddRTContent).

 

Below you will find a list of all possible settings that can be used in the parameter <OptionID> with N2PDFSetOption. The respective setting values are made using the parameter <OptionStr>. The last parameter is unused and therefore always set as "".

 

N2PDFOPTION_MIME_MODE

This parameter can be used to specify how MIME content should be converted if it is present in documents. It offers three possible methods:

 

N2PDFVALUE_MIME_DEFAULT

This is the standard method. It uses the standard backend conversion from Lotus Notes to transfer the content stored in the documents to the PDF format.

N2PDFVALUE_MIME_CONVERT

Uses n2pdf’s own HTML parser to display the stored content. A conversion from HTML to RTF is carried out.

N2PDFVALUE_MIME_FILEEXPORT

Exports the entire content as an EML file. This is subsequently processed further as a normal attachment. In doing so, your currently applicablemanner of attachment handling is used as the basis.

 

 

112

When using N2PDFVALUE_MIME_FILEEXPORT, please bear in mind the applicable particularities / limitations of the respective manners of attachment handling.

 

 

112

The output of the converted content in PDF may differ depending on the method selected.

 

Sample conversion for export and further processing using webPDF:

 

‘Activation of the EML export

Call N2PDFSetOption ( JobID, N2PDFOPTION_MIME_MODE,N2PDFVALUE_MIME_FILEEXPORT,"")

 

‘Activation of the EMBED mode

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_MODE, N2PDFVALUE_ATTACHMENT_EMBED_MODE, ""  )

 

‘The exported EML file is converted to PDF by webPDF and is subsequently embedded

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_EMBED_PDF_CONVERT, N2PDFVALUE_TRUE, ""  )                

 

‘File attachments are embedded at the original position of the Note document

Call N2PDFSetOption ( JobID, N2PDFOPTION_ATTACHMENT_EMBED_AT_POS, N2PDFVALUE_TRUE, ""  )                                

 

‘Display of the original attachment is prevented

Call N2PDFSetOption ( JobID, N2PDFOPTION_EXPORT_HIDE_ATTACHMENT, N2PDFVALUE_TRUE, ""  )

 

‘Transfer of the Notes document with MIME content

Call N2PDFAddRTContent ( JobID, N2PDFVALUE_CONTENT_BODY, PageBreak,_

db.Server, db.FilePath, doc.UniversalID, "")

 

 

 

N2PDFOPTION_MIME_EML_FILE_NAME

With this parameter you can define a filename which is to be applied when exporting using N2PDFVALUE_MIME_FILEEXPORT . If you do not define a filename, then "Mimepart.eml" is used as the filename.

 

 

  Call N2PDFSetOption ( JobID, N2PDFOPTION_MIME_EML_FILE_NAME, "filename.eml","")

 

or, for example:

 

  Call N2PDFSetOption ( JobID, N2PDFOPTION_MIME_EML_FILE_NAME, CStr(doc.Subject(0)),"")

 

 

 

N2PDFOPTION_MIME_DOWNLOAD_IMAGES

With this parameter, you can specify whether all of the images from an e-mail or an HTML document which are not stored in the document should be loaded automatically.

 

N2PDFVALUE_TRUE

Load externally linked image information

N2PDFVALUE_FALSE

Linked image information is not loaded

 

Call N2PDFSetOption ( JobID, N2PDFOPTION_MIME_DOWNLOAD_IMAGES, N2PDFVALUE_TRUE, "" )

 

 

112

There must be an Internet connection to be able to use the option correctly because the contents of the linked data source must be retrieved.

 

112

Activating this option can considerably slow down the conversion if many images must be retrieved during the conversion or if many of the images on the linked data source can no longer be retrieved. When doing this, please also bear the following option in mind: N2PDFOPTION_MIME_DOWNLOAD_TIMEOUT.

 

 

N2PDFOPTION_MIME_DOWNLOAD_TIMEOUT

You can use this parameter to define the time to wait when downloading the external images before the query is aborted. The duration is specified in seconds and only refers to the document to be converted, not to the entire conversion.

 

112

Please remember that if a value which is too high is selected, the conversion can be slowed down considerably. The primary purpose of a timeout is to avoid waiting for downloads which are no longer available at the target address.