How to set print GUI options

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

How to set print GUI options

Post by lidds »

I am using the following command to launch the Print dialog form.

Code: Select all

Me.docPreview.PrintWithDlg()
However I want to set the "Select Paper Size by Deocument's Page Size" option to True. How can I do this?

I know that I could do the following, however this does not show the Print dialog and just sends it directly to the printer, which I do not want.

Code: Select all

Dim op As PDFXEdit.IOperation = Nothing
op = Me.docPreview.Inst.CreateOp(Me.docPreview.Inst.Str2ID("op.document.printPages"))

Dim doc As PDFXEdit.IPXV_Document = Me.docPreview.Doc
Dim input As PDFXEdit.ICabNode = op.Params.Root("Input")
input.Add().v = newDoc
op.Do()
Dim opExecFlags As Integer = 0
Me.docPreview.Inst.AsyncDoAndWaitForFinish(op, CUInt(opExecFlags))
Just a bit stuck?

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to set print GUI options

Post by Sasha - Tracker Dev Team »

Hello Simon,

Use the e.operBeforeExecute event to intercept the operation (use forum search for samples) then if it's the print operation, change the options as you need. Then the dialog will be launched with those settings.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: How to set print GUI options

Post by lidds »

Alex,

Thank you for the advise. However I am using the "cmd.print" command and unfortunately this does not fire the e_operBeforeExecute event?

Is there another way?

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to set print GUI options

Post by Sasha - Tracker Dev Team »

Hello Simon,

Here's the topic that would prove useful:
viewtopic.php?f=66&t=30597&p=122214&hil ... og#p122214
After you have the IUIX_Dialog, you can get the "prn.ck.choosePaperByPage" IUIX_Checkbox and do:

Code: Select all

dlg.CheckItem("prn.ck.choosePaperByPage", 1);
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply