Welcome Guest Search | Active Topics | Sign In | Register

Where is the PdfViewer after print event? Options
Matt
Posted: Wednesday, September 27, 2017 12:32:13 PM
Rank: Newbie
Groups: Member

Joined: 2/27/2015
Posts: 7
Using following code:

PdfViewer pdfViewer = new PdfViewer();
pdfViewer.Load(job.DocumentData);
pdfViewer.Print(ps, pgs);

Can't seem to find after print event.

Tried this:

pdfViewer.WebView.AfterPrint, but it says "WebView" is not a property of pdfViewer.
eo_support
Posted: Wednesday, September 27, 2017 1:30:41 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,225
Hi,

You won't have direct access to the underlying WebView used by the PdfViewer class. In order to be notified after the Print is done, you will need to rely on the WaitableTask object returned by you from the Print method. The code will be something like this:

Code: C#
//Start the printing task
EO.Base.WaitableTask task = pdfViewer.Print(ps, pgs);

//Attach Done handler to the task
task.OnDone(() =>
{
    ....code to be called when the print is done....
});


Additionally, you can not do silent print with PdfViewer class. PdfViewer is a control and the control must be initialized and visible on screen before you can print its contents. This means you will need to create a Form (or a Window in WPF), add the PdfViewer control into the Form (or Window), wait for its IsReady to become true (you can rely on IsReadyChanged event), and then call its Print method.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.