Split PDF pages in multiple files

You can use the PDF Printer to split a PDF into multiple files. Each file will have one page from the original PDF.

It is as simple as adding the <pageno> macro name to the output file name. Here is an example:

Split PDF

Using the file name “test – <pageno>.pdf” will result in files named “test – 1.pdf” for the first page and so on.

Additional formatting can be added to the page no. If you write <pageno,3> the number will be zero padded to the length of 3 characters. The padding character can be specified as an additional parameter such as <pageno,3,->. This will create a page number like –1, –2, etc.

See the documentation about macros for more information.

Print PDF from Microsoft Outlook

This post contains a VBA macro that will set the output file name to a cleaned version of the subject. The selected mail item is then printed.

Note that Outlook remembers the last printer used. Therefore you have to use the PDF printer before you run this macro. Otherwise, Outlook will just print to another printer.

Option Explicit

Public Sub PrintPdf()
  Dim mi As MailItem
  Dim o
  Dim p As Integer
  Dim subj As String
  Dim illegalchars As String
  Dim i As Integer
  Dim output As String
  Dim settings As Object
  
  For Each o In Application.ActiveExplorer.Selection
    If TypeName(o) = "MailItem" Then
       Set mi = o
       subj = mi.Subject
   
       Rem -- Clean reply and forward prefixes
      Do
         p = InStr(1, Left(subj, 4), ":")
         subj = Trim(Mid(subj, p + 1))
       Loop While p > 0
    
     Rem -- Remove illegeal file  name characters
     illegalchars = "<>:""/\|?*" 
     For i = 1 To Len(illegalchars)
       subj = Replace(subj, Mid(illegalchars, i, 1), "_")
      Next
    
      Rem -- Remove double underscores
      Do
        p = InStr(1, subj, "__")
        subj = Replace(subj, "__", "_")
      Loop While p > 0
    
      Rem -- Create the COM settings object to control the printer.
      output = "C:\Temp\" & subj & ".pdf"
      Set settings = CreateObject("bullzip.PdfSettings")
      settings.SetValue "Output", output
      settings.SetValue "RememberLastFolderName", "no"
    
      Rem -- Write settings to the runonce.ini.
      settings.WriteSettings True
    
      Rem -- Print the object
      Debug.Print "Printing: " & subj
      mi.PrintOut
    End If
    Exit For
  Next
End Sub

When you have created the macro, you can customize your ribbon and give it an icon.

outlook-macro

Append to PDF without dialogs

This article outlines how you can use the PDF printer to continue to append to the same PDF document without showing any dialogs when you print.

The first step is to open the options dialog from your start menu. This is where we set the default settings for the printer.

You should define an output file name. This is the file that will collect our print jobs over time. Each time you want to start over, you should delete this file. In addition to that you enable the Append if output exists.

On the Dialogs tab, you select never and never to hide all the dialogs.

Select no in Open the document after creation to prevent the PDF from opening when the print is finished.

That is all. Now you can print to the PDF printer and it will continue to build you collect.pdf on your desktop.

If you is something you need on a regular basis, you can install a second PDF printer with another name and configure that to collect the print jobs.