Menu Close

How to Save Email with Attachments into One PDF Using Attachment Names as Bookmarks

2PDF allows you to convert an Outlook email message file (MSG, EML) to a PDF. In addition, the resulting PDF file can contain bookmarks to help you navigate to each attachment in the "Bookmarks" (or "Table of Contents") section. Bookmark names will correspond to the attachment names.

How to save an email with attachments as a PDF with bookmarks

  1. Open 2PDF Settings with this command:

    2PDF.exe -ini

  2. Navigate to Advanced Settings and locate the PDF settings (AttachmentsConvert attachmentsOutput formatsPDF);
  3. Add macro {*SrcFileName} for the New file bookmarks title template setting. You can insert it manually or click the {=} icon and choose FilenameSource file name;
  4. Click OK to save changes and close 2PDF Settings;
  5. Run the conversion command. For example, use this command to convert a file called "Email.msg":

    2PDF.exe -src "C:\In\Email.msg" -dst "C:\Out" -pdf multipage:append combine:{containername}.pdf

Note: The macro {containername} for the combine: parameter will keep the original email file's name. 

For source (-src), you can use different file mask filters: 

  • "C:\In\Email.msg" – to specify a particular file "Email.msg"
  • "C:\In\*.msg" – to specify any .msg files contained in the "In" folder
  • "C:\In\*.eml" – to specify any .eml files contained in the "In" folder
  • "C:\In\*.*" – to specify all files contained in the "In" folder
  • "C:\In\Email.msg" "C:\In\Email.eml" – to indicate 2 files that need conversion

As a result, 2PDF will create a single PDF document with a bookmarks navigation panel showing the original email filename and attachment names:

Save email as PDF with bookmarks section

How to merge multiple EML or MSG email files into a PDF with bookmarks

  1. Open 2PDF Settings with this command:

    2PDF.exe -ini

  2. Navigate to Advanced Settings and locate the PDF settings (AttachmentsConvert attachmentsOutput formatsPDF)
  3. Add macro {*SrcFileName} in the New file bookmarks title template setting field. You can add it manually or click the {=} icon and choose FilenameSource file name;
    How to merge multiple EML or MSG email files into a PDF with bookmarks
  4. Click OK to save and close 2PDF Settings
  5. Run the conversion command. For example, use this command:

    2PDF.exe -src "C:\Emails\*.*" -dst "C:\Out" -pdf multipage:append combine:"my multipage.pdf"

If you want to set a particular order in which files will be converted (e.g., by name or date), add the -options sort parameter to the command line. For example: 

2PDF.exe -src "C:\Emails\*.*" -dst "C:\Out" -pdf multipage:append combine:"my multipage.pdf" -options sort:date

As a result, 2PDF will combine all files from your source folder and convert it into a single PDF document. The PDF will include a navigation panel with bookmarks showing the original email filenames and attachment names.

Output PDF with emails and attachments and bookmarks