Printing to PDF or Email with Background Image

Version Relevance: 3.0012 onward

Issue: We have many of our documents such as Invoices and Orders custom designed to print on our headed paper which works very well for hard copies but when printed to the PDF or Email report destination the consequential PDF does not contain any of our company details and no logo etc..

Dec 3rd, 2007

Feedback: With the release of V2 of Brainy Data's PDF Device external, we can now accommodate exactly this need and potentially many other requirements possible for differences between PDF output and that for other report destinations. The full capabilities of the V2 PDF Device have been implemented in Caliach Vision V3.0012 onwards. Further, with this change a more comprehensive mechanism for default user-saved PDF settings and individual report design saved PDF settings has been implemented. Note that the latest version of the PDFDevice.dll or Mac equivalent must be downloaded and installed in the xcomp directory of your Omnis Studio directory tree(s).

Default PDF Settings: To set up default settings for the PDF report destination, you need to go to File -- Report Destinations -- Settings, then select the PDF destination icon, then clock the Parameters tab pane, and finally click on the Advanced... button. This will open the PDF Settings window ?.

The normal settings in most cases would be as shown in the help images (click here to view), with the exception of the Watermark and Background tab panes. Watermark would typically be off, as would Background image. These settings will apply to all reports sent to the PDF destination or when sent to Email with PDF attachments. They are saved to the user settings, so will apply to the individual user. Each user needs to set their own default settings. This is done so that if you wanted each user to have a personalised watermark or background image, you can. There are two ways of applying a background image. Firstly, you can paste a picture directly into the settings in the picture field. This will be stored with the settings, but if this is done to many individual reports, the same picture will be stored in each report class which could be detrimental to space and performance. Secondly, and better for common graphics is to store the image in a file in the Graphics directory beside the datafile. You then use the Filename setting to enter the file name path within the Graphic directory. The program will then read that file and use that image rather than a stored one. A cashe system is used by the program so the file is only read once per session when you first print with it, thereafter it is pulled from memory.

While the PDF destination default user settings are useful in themselves, you can also apply different settings to individual report designs (classes). Clearly, if you want to apply a letterhead PDF background image to your custom stationary documents, you cannot use the destination user default settings because all reports would then contain the letterhead background which would be inappropriate for normal listing reports which are not designed to be printed on letterhead paper. So you need to be able to individually apply settings to only particular report designs, and this can be done from the File -- Advanced -- Report Setups window ?.

From the Report Setups window you can select one or a number of report designs, say all your custom document designs that normally print to letterhead paper stock. Then go to the second tab pane and click the PDF Settings for Selected button. This will open the same PDF Settings window but this time it has an additional Remove Settings from Reports button on the lower left.

This window accommodates multiple open libraries, so you can open it after operating the File -- Advanced Custom Feature Utility function that opens you design environment for report customisation and apply settings to your master designs.

This is how I organised the application of PDF background letterhead images for our own operational system:-

  1. First I scanned a copy of our letterhead using a bed scanner and saved it full size at 120DPI (dots per inch) and saved the scan as a JPEG image with maximum quality with the name LeterHead.jpg. You could use PCX, Windows BMP, Mac PICT formats. You could use higher resolution DPI but watch out for file size and this must be reflected in the setting of DPI in step 7 below.
  2. I then launched Caliach Vision using the Omnis Studio design program (as opposed to the runtime).
  3. After logging in, I operated File -- Advanced -- Custom Features Utility to open my OpenVision.lbs.
  4. I then operated File -- Advanced -- Report Setups which listed for me all report classes in both the VISION and OPENVISION libraries.
  5. Now I carefully selected all the report classes that a background letterhead image would be appropriate in my OPENVISION library. Clicked on the Modify and Page Setup tab pane and the PDF Settings for Selected button to open the PDF Settings window.
  6. If no settings have been applied individually to the first selected report, by default the window is preloaded with my user default settings. So I leave everything alone and only go to the Background tab pane.
  7. In the background tab pane I set:
    Enable background image = Checked
    Print on first page only = Checked
    Do not scale image = Selected
    Left Offset = 0.000
    Top offset = 0.000
    Image DPI = 120
    Filename = LetterHead.jpg
  8. I also checked that there was no image in the picture field by clicking in it and pressing the Del key. This is in case we inherited an image that we now don't need and would not want unnecessarily stored in each of our report classes (easily done and a waste of space and performance).
  9. Then I clicked the Ok and all my reports are set up!
  10. Finally I used the Change Management System to update my ProgCode.usa file with all the changed report designs, and posted that to the server so that all users would be updated.
  11. Finally, I tested the updated Caliach Vision, and low and behold all was working to plan!

The whole process took 15 minutes and now we have email PDF documents that look like the real thing and in full colour as well!

Click here to view the resulting PDF output of an Invoice (to a now bankrupt company).

Chris Ross - Caliach Design