We have been given a PDF that needs to be sent out with many of our letters and reports. The letters are single sided, and the PDF is double sided. We don't have control over the PDF, it is locked.
I have tried using the report.printer_override function to change the behavior of the printer to be duplex, but we are just doing a sys_print() of the pdf, and I think the report.printer_override works only with "reports" or "letters" created in Alpha. I was hoping there were options on the sys_print, but no luck.
This is the code I'm using. If anyone can see what I'm doing wrong, it would be greatly appreciated.
Tom
I have tried using the report.printer_override function to change the behavior of the printer to be duplex, but we are just doing a sys_print() of the pdf, and I think the report.printer_override works only with "reports" or "letters" created in Alpha. I was hoping there were options on the sys_print, but no luck.
This is the code I'm using. If anyone can see what I'm doing wrong, it would be greatly appreciated.
Code:
DIM vcprinter as C = UI_PRINTER_DEFAULT_GET() DIM ans as C = "" 'see if they have the EBT Printer as a choice temp=ui_printers_get() 'Select the correct printer name this should work for any OS ans = alltrim(*for_each(foo,if((vcprinter $ word(temp,*counter(),crlf())),word(temp,*counter(),crlf()),""),temp)) delete options dim options as P dim options_text as C ' Before you can initialize 'options' using the property_from_string() function at least one dot variable must exist. therefore, create a dummy variable. options.dummy = 1 options_text = <<%str% <duplex="Horizontal"> %str% ' Create a dot variable from options_text. ' The dot variable contains the printer properties to be overridden property_from_string(options, options_text) ' Now you can delete the dummy variable delete option.dummy ' oldOptions will store the current printer options, so that we can restore them. delete oldOptions dim oldOptions as P oldOptions.dummy = 1 ' Set the printer override settings. old_printer_name = report.Printer_override(ans, options, oldOptions) sys_print("G:\BCBSS\Non Discrimination Statement-revised 3-1-17.pdf") report.Printer_override(ans,oldOptions)
Comment