Converting email files to PDF

Some common email file formats (MSG, EML, EMLX) are supported for conversion to PDF. Some PDF standards do not allow embedding files (like PDF/A-1) but other allows the embedding of PDF- (PDF/A-2) and also non-PDF-files (PDF/A-3) into another PDF file. To match these different targets, using pdfaPilot CLI it is possible to define variety of different settings for handling attachments of emails. In general a PDF is created with --emailtopdf This will create a PDF containing all attachments, those who can be converted as PDF (like Office files or images), all other in their native format.

--emailtopdf <email file> 

Settings for email conversion

--emailtopdf 
  [--level=<level>] 
  [--attachments=<parameter>,<parameter>,...] 
  [--onerror=<parameter>] 
  [--embedsource] 
  [--noembed=<file type>,<file type>,...] 
  [--noconvert=<file type>,<file type>,...] 
  --template=<path to folder> 
  <email file>  

--level

You can define the required PDF/A level (default is no PDF/A conversion).

Parameters

level

4, 4e, 4f, 3b, 3u, 3a, 2b, 2u, 2a, 1b, 1a or No (default: No)

--attachments

Depending on the defined parameter, attachments will not be embedded or embedded in their original file format, converted to PDF or as pages. The parameters can be combined comma separated.  

Parameters

IGNORE

Attachments will be ignored and not converted or attached

ORIGINAL

Attachments will be embedded in their original file format

PDF

Attachments will be converted to PDF (if possible) (Default)

PAGES

Attachments will be converted (if possible) and attached as additional pages to the email content

--onerror

If an attachment can not be converted to PDF, this setting allows the defi-nition of handling such email files.

Parameters

ABORT

Aborts processing if an attachment can not be converted to PDF

SKIP

Attachment will be skipped and reported on the CLI.

FALLBACK

Attachment will be embedded in original file format, if it can not be converted to PDF. If a PDF/A-level has been selected, PDF/A-3 with the respective sublevel will be used. (Default)

--embedsource

The email-file itself will also be embedded in the resulting PDF.

--noembed

RegEx expression for file type extensions for attachments, which will not be embedded or converted to PDF although is attached to the email file. Samples for valid RegEx (RegEx is case-sensitive, "(?i)" will make it case-insensitive. --noembed=".*.vir" matches extension "vir" in small letters --noembed=".*.(VIR|EXE)" matches the listed extensions in big letters --noembed="(?i).*.VIR" matches all possible variations of "VIR"

--noconvert

RegEx expression for file type extensions for attachments, which will not be embedded or converted to PDF although is attached to the email file. See --noembed for RegEx samples.

--template

It is possible to create own HTML-Template and Cascading Style Sheets (CSS) to adjust the visual appearance of the created PDF.

Creating custom templates for email conversion

In order to get a "customizable" template, go to:

/var/Mail/Templates/Basic/manifest.xml

and temporarily set:

<x:settings>
   <x:keeptemp>true</x:keeptemp>
</x:settings> 
Click to copy

A folder "Email.html" is created next to the email when you now execute any email conversion, like:

pdfaPilot.exe --emailtopdf Email.msg

You can now set:

<x:keeptemp>false</x:keeptemp>
Click to copy

in Email.html/manifest.xml and again run your conversion command, like:

 pdfaPilot --emailtopdf Email.msg --template=Email.html

Please note that the files and folders mentioned above should not be edited because all changes will be ignored/overwritten. The static data can be used only to verify the current visual appearance without any execution with pdfaPilot again.