Page 1 of 1

Own Print and Print Preview dialog

Posted: Thu Sep 18, 2014 3:20 pm
by Stoil
How can print/print preview document with AX Viewer but with own print dialog?
What code can we use to do this without UI of Exchange Viewer AX Control?

Thank you in advance,
Stoil

Re: Own Print and Print Preview dialog

Posted: Thu Sep 18, 2014 3:51 pm
by Tracker Supp-Stefan
Hi Stoil,

I am not 100% sure this will work - but you need to capture the event that the user is starting the printing process - cancel the dialogue, and then display your own.
After that - you can print via call to the core of the Viewer AX without further User inteaction with our own print dialogue:
"How to Print a Document"

This topic might also be useful:
https://forum.pdf-xchange.com/ ... 08&p=52345

Regards,
Stefan

Re: Own Print and Print Preview dialog

Posted: Fri Sep 19, 2014 8:51 am
by Stoil
Thank you, Stefan about fast answer.
It seems that I cant use AX Viewer control to do my own print process.
If I want to have my own print preview, I have to be able to print Page by Page and have method like :
[DllImport("pxcview")]
public static extern int PXCV_DrawPageToDC(IntPtr hDoc, Int32 page_num, IntPtr hDC, ref PXV_CommonRenderParameters pParams);

Have to use pxcview.dll for this?

Buying PDF-XChange Viewer SDK maybe only this DLL gives me own printing possibility???
Or We have to buy and another SDK ?

Regards,
Stoil

Re: Own Print and Print Preview dialog

Posted: Fri Sep 19, 2014 10:08 am
by Serg - Tracker Dev
You can't use ActiveX for render pages of the document to your own DC.
But you can use pxcview.dll for that task.
That DLL allow you to open PDF document and render any page to your own DC (and for your own printer too).
PDF-XChange Viewer Simple DLL SDK included into PDF-XChange Viewer SDK

For example of usage you can look into pxcview sample.

Re: Own Print and Print Preview dialog

Posted: Fri Sep 19, 2014 12:52 pm
by Tracker Supp-Stefan
Hi Stoil,

I assumed you just want a custom print preview dialogue, and then let the Viewer handle the rest of the printing.
Otherwise - just as Serg suggests - use the Viewer Simple DLL SDK to render to a DC!

Regards,
Stefan

Re: Own Print and Print Preview dialog

Posted: Fri Sep 19, 2014 6:53 pm
by Stoil
Thank you, Serg & Stefan.
I want to make own Print Preview Dialog using System.Windows.Forms.PrintPreviewControl and System.Drawing.Printing.PrintDocument of C# .Net
I can't imagine how to implement your idea Stefan.
I do want to do print preview with little effort. But I do not see how to do this with AX Viewer Control.

And that's why I ask if there is a way to do this with AX Viewer and if there is not a way, I will do preview with xcview.dll, using C# sample.

If I can use print preview dialog of AX Viewer in Bulgarian and Russian language, it will be the best! :)

Regards,
Stoil

Re: Own Print and Print Preview dialog

Posted: Fri Sep 19, 2014 9:48 pm
by Vasyl-Tracker Dev Team
Hi Stoil.

If you want to use printing process by Viewer ActiveX but with your own print-dialog - you may add in your UI the own 'Print' button, then, when user clicked on that - show your own print-dialog, fill our global print-parameters and then call our pdfControl.PrintDocument(... PXCVA_NoUI);

HTH.

Re: Own Print and Print Preview dialog

Posted: Mon Sep 22, 2014 9:24 am
by Stoil
Thank you, Vasil.
I intend to do this about printing. But I have problem with implementing print preview.
We have program with UI in 3 different languages and I have to show print preview dialog with localization of these languages.

That's why I ask about opportunity of doing this with Viewer ActiveX.

Can I localizate print preview dialog of Viewer to other languages?
or
Can I use some code of Viewer to do own print preview?
or
I have to use Viewer Sipmle PDF DLL SDK using the code from pxcview sample?

Regards,
Stoil

Re: Own Print and Print Preview dialog

Posted: Mon Sep 22, 2014 4:00 pm
by Vasyl-Tracker Dev Team
Hi, Stoil.
Can I localizate print preview dialog of Viewer to other languages?
Sure, you can. Look to <AppFolder>/Languages/ and create and fill your own PDFXVW_<langID>.xml file. Note: this file shoud contain the special and unique value for attribute lcid. You may take your lcid value from there:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

HTH.