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

Excel preview shows many pages but strange or no output

Some Excel sheets show a strange behavior when you print them or do a print preview. This can be caused by the wrong DPI setting for the Excel sheet you are looking at.

It is easily fixed if you change the DPI setting to something meaningful.

First, you click the small icon on the Page Layout tab.

excel page layout

Second, you change the print quality to something like 300 dpi.

excel page setup

Now, you should be able to print your document.

Color problems with a background PDF

Some PDF documents change the colors when they are used as background for another PDF. This is often the case for PDF files created with other tools where the color information is not fully compatible.

Print PDF to a new PDF with Bullzip

You can often get the colors right if you print the existing background PDF to a new PDF using the Bullzip PDF Printer. Simply open the background PDF in Adobe Reader and print it to the Bullzip PDF Printer. Then use the new PDF as the background PDF.

If this doesn’t work, you can try the same procedure with at different PDF viewer. Instead of Adobe you can use Sumatra PDF Reader, which is a free reader available for download on the Internet. This has often produced good results.

PDF Compatibility Level

You can also try to change the compatibility level of the PDF that you create. This can also be used when you create the background PDF by printing it from another reader as mentioned above.

PDF Color Model

In the PDF options dialog, there is an option to change the color model used, when creating a PDF. Try to experiment with that as well.

Hopefully, one of the strategies mentioned here will help you solve the color issue when using another PDF as a background. These methods should all preserve the vector based information intact and deliver the best quality possible.

 

Merging of PDF files

In this article, I will try to explain why some users experience problems when merging multiple documents.

The printer is designed to process print jobs in parallel. This means that it will start processing a job even before the previous job has finished processing. Consequently, you can run into trouble if you expect to merge the current print job with a previous one that has not finished yet. The result is that you get a document with missing pages.

One solution is to wait for the previous job to finish before you start the next one. This requires that you control the creation of the documents in the print queue.

Another solution is to tell the PDF printer to stop processing jobs in parallel mode and do it one by one. You control the processing with a registry setting called GUITimeout. The use of the GUITimeout setting is described in the BioPDF documentation.

Switching to sequential mode will lower the performance when processing multiple jobs. Another side effect is also that on Citrix or Terminal Servers, one user can block the job processing for another user. Other than that, the setting is safe to use.

Save to same path

Users often ask if they can make the printer save the PDF document in the same folder as the original printed document.

This is not possible because the printer does not know anything about the original document. It only processes a print job which does not contain any information about the path of the original.

DEP crashes programs on Windows Server 2008 R2

If you experience random crashes on Windows Server 2008 R2, you may have a problem with the DEP (Data execution protection).

On Windows 2008 R2 there seems to be a problem with DEP. We have seen the crashes stops if users disable it for the gui.exe process or entirely. Often the crashes are logged by the Windows Event Log. According to the log they stem from random DLL files with no association with the PDF printer.

Here is how to disable it:

Open Control Panel, click on System and Security→ System → Advanced system settings. In the Advanced tab, click on the Settings button in the Performance section (the first one). In Performance Options, Data Execution Prevention has its own tab.

The odd thing about this finding is that has only been seen on Windows Server 2008 R2. Earlier or later versions of Windows Server has not shown this problem.

Rotation of Pages

By default, the pages will be rotated automatically based on the text content in the document. However, you may want to change this default behavior from time to time. Sometimes the program cannot find any text to base the decision on. It can also be the case that you have multiple lines of text written at different angles.

You can change the default rotation options on the “Other” tab in the Options dialog.

advanced-tab

You can experiment with these settings to get the result you want.

If the text in your document is printed as graphics it cannot be used by the program to determine the orientation.

Hyperlinks in your PDF

Using hyperlinks in your PDF documents are only partially supported. The problem is that a hyperlink often consists of a text and an underlying information about the link. When the PDF printer is asked to print a document, it only sees what would normally be printed on a paper. This means that it does not receive the underlying link information.

Without the link information it can only print the text or image from the hyperlink. It is then up to the PDF reader to decide if it wants to present the text as a hyperlink or not.

Adobe Reader will look at the text and try to determine if it is a valid hyperlink or not. It will normally look for text starting with http:// or www. Therefore, it is recommended that you write the full hyperlinks in your text, so that it is recognized and useful in the PDF document.

Links inside documents, such as Microsoft Word documents, are not usable in the printed PDF document for the same reason.

If you need the hyperlink information outside these limitations, you normally need the printing program to be able to export to PDF. It will alone know what the underlying or hidden link information is.

Custom paper size

This will show you how to use the custom paper size when creating a PDF document.

Please note that you should lower your DPI setting if you create very large custom pages. Otherwise, the resulting file size will increase dramatically. You can experiment with this feature to find the right mix between file size and output resolution.

Custom Page Size Example

Let us create a small text in Notepad.

custom-paper-size-notepad

Then we print the document.

printer-dialog

Click Preferences

preferences

Go to the advanced settings

custom-pdf-page-size

Select the PostScript Custom Page Size

custom-pdf-page-size-editor

Edit the custom page size to the dimensions

custom-pdf-page-size-result

The resulting PDF should match the custom page size you selected