Own Print and Print Preview dialog

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

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

Post Reply
Stoil
User
Posts: 43
Joined: Wed Dec 04, 2013 5:07 pm

Own Print and Print Preview dialog

Post by Stoil » Thu Sep 18, 2014 3:20 pm

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

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13422
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Own Print and Print Preview dialog

Post by Tracker Supp-Stefan » Thu Sep 18, 2014 3:51 pm

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:
http://www.tracker-software.com/forum3/ ... 08&p=52345

Regards,
Stefan

Stoil
User
Posts: 43
Joined: Wed Dec 04, 2013 5:07 pm

Re: Own Print and Print Preview dialog

Post by Stoil » Fri Sep 19, 2014 8:51 am

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

Serg - Tracker Dev
User
Posts: 14
Joined: Wed Sep 17, 2014 7:40 am
Location: Ukraine

Re: Own Print and Print Preview dialog

Post by Serg - Tracker Dev » Fri Sep 19, 2014 10:08 am

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.

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13422
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Own Print and Print Preview dialog

Post by Tracker Supp-Stefan » Fri Sep 19, 2014 12:52 pm

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

Stoil
User
Posts: 43
Joined: Wed Dec 04, 2013 5:07 pm

Re: Own Print and Print Preview dialog

Post by Stoil » Fri Sep 19, 2014 6:53 pm

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

User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 1923
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Own Print and Print Preview dialog

Post by Vasyl-Tracker Dev Team » Fri Sep 19, 2014 9:48 pm

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.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.

Stoil
User
Posts: 43
Joined: Wed Dec 04, 2013 5:07 pm

Re: Own Print and Print Preview dialog

Post by Stoil » Mon Sep 22, 2014 9:24 am

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

User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 1923
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Own Print and Print Preview dialog

Post by Vasyl-Tracker Dev Team » Mon Sep 22, 2014 4:00 pm

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.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.

Post Reply