41
©2002-2016, Ido Millet, ido@MilletSoftware.com
Page 147
Using PDF_Print_Split_Tag
The advantage of this option is its ability to dynamically control paper trays using formula logic
from within Crystal reports. For example, it makes it easy to print the first and last pages in each
group using one tray and print the rest of the pages from another tray.
This command line argument structure is as follows:
…
"PDF_PRINT_SPLIT_TAG:c:\temp\Test.pdf>\\srv2\Laser3"
The parameters (after the ":") are as follows:
1. PDF_File: The PDF file you wish to print.
2. Printer_Name (use "Default" to print to the default printer)
Visual CUT searches each page in the pdf document for text tags that look like:
#Tray::2#
(in a case where the tray number is used) or
#Tray::Bypass Tray#
(in a case where the tray name is used)
Typically, these tags would be placed as Crystal formulas on the report being exported to pdf.
For example, this formula (placed in the page header of the report) would cause the 1
st
page to
use tray 3 and the rest of the pages would alternate between Tray 2 and Tray 1:
WhilePrintingRecords;
Global StringVar gs_Printer_Tray;
IF gs_Printer_Tray = "" THEN gs_Printer_Tray := "3"
ELSE gs_Printer_Tray := Cstr(Remainder(PageNumber,2) + 1,0);
"#Tray::" & gs_Printer_Tray & "#";
Notes:
1. set the font color of the formula to white, the tag would be invisible on the report as well as
on the pdf file, but Visual CUT would still have access to it. Alternatively, if
you keep the
PDF_Tags_Delete_Default option in DataLink_Viewer.ini as True, Visual CUT removes the tag text
after processing it. Use non-proportional font for the tag formula (avoid Calibri and Bold/Italic).
2. The tag doesn't have to appear on every page of the report. Pages that don't have the tag
would be printed to the paper tray last specified in previous pages.
3. Tray numbers are not always obvious; "Tray 2" could actually be Tray #3 internally. Hence,
you should probably use Tray Names instead of Tray Numbers in the Tags.
4. Visual CUT sets the print job names shown in the printer queue to reflect the page range
and tray name. This makes it easy to monitor the process.
5. Make sure the printer is not setup to automatically select the paper source.
6. To control print quality/speed, use the PDF_Print_Mode command line argument.