Change Printer settings at run time

Posted by ankitshukla on 14-Apr-2016 09:13

Hi,

Is there any way to change the printer settings (like page size etc) at run time while printing the doc though any script.

NOTE: This should not change the default settings of the printer.


Thanks,

Ankit 

All Replies

Posted by ankitshukla on 19-Apr-2016 00:47

Anyone have any idea or clue please...

Posted by cSocaciu on 19-Apr-2016 01:14

I think you must use the external DLL libraries under windows to achieve this:

PROCEDURE PageSetupDlgA EXTERNAL "comdlg32.dll":U:
    DEFINE RETURN PARAMETER answer AS SHORT.
    DEFINE INPUT-OUTPUT PARAMETER tagPSD AS MEMPTR.
END PROCEDURE.

PROCEDURE PageSetupDlgW EXTERNAL "comdlg32.dll":U:
    DEFINE RETURN PARAMETER answer AS SHORT.
    DEFINE INPUT-OUTPUT PARAMETER tagPSD AS MEMPTR.
END PROCEDURE.

Posted by ankitshukla on 20-Apr-2016 09:37

Thanks Socaciu.

But can you please provide an example for using these procedure from this dll. I am actually new at using dlls in progress code. If you have any reference for it then that will be more helpful for me.

Posted by fred.hill on 20-Apr-2016 09:48

Take a look at this project on GitHub.  In the Progress subdirectory it has an example of how to call the methods in a .DLL (or a .so on Linux/Unix) from a Progress program.

github.com/.../Progress

Posted by cSocaciu on 20-Apr-2016 13:46

The related msdn page contains instruction on how to write the code needed:

look for "Setting Up the Printed Page"

msdn.microsoft.com/.../ms646829(v=vs.85).aspx

This thread is closed