This is a migrated thread and some comments may be shown as answers.

Mass Printing

5 Answers 104 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Lukas
Top achievements
Rank 1
Lukas asked on 24 Sep 2012, 01:33 PM
Hey!

We have the following scenario in Silverlight 5: We want to print multiple invoices in one run. One invoice consist of one or more pages. One page has all the invoice positions and the other one a summary page that has to be printed on special paper (empty payment slip). The invoices are present on the server in two PDF-files per invoice. One PDF for the positions and one PDF for the summary page.

What we need to do is to display the print dialog twice (to let the user chose the different printers) and then print all PDF-files in order. The order is:

Invoice #1 Part 1 -> With PrintSetup1
Invoice #1 Part 2 -> With PrintSetup2
Invoice #2 Part 1 -> With PrintSetup1
Invoice #2 Part 2 -> With PrintSetup2
[...]

Is this possible with the RadPdfViewer control - or any other Telerik control?

Thanks
Lukas

5 Answers, 1 is accepted

Sort by
0
Kammen
Telerik team
answered on 25 Sep 2012, 03:35 PM
Hi Lukas,

You scenario seems to be more complex than what RadPdfViewer supports.

You can try to implement you own custom printing. Luckily, in Silverlight you can print a visual, so you can use the FixedDocumentSinglePagePresenter class in order to print a RadFixedPage (that is a PDF page). This can be achieved by setting the Page property of the class and the content will be created.

You should note that the content in this presenter is created asynchronously, so the printing should be executed on ContentCreated event.

Hope this answer your question. 


Greetings,
Kammen
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Lukas
Top achievements
Rank 1
answered on 25 Sep 2012, 03:38 PM
Thank you for your answer.
How would go about selecting the correct printing target? (e.g. Printer #1, PaperSource #2)
0
Kammen
Telerik team
answered on 26 Sep 2012, 02:58 PM
Hi Lukas,

The FixedDocumentSinglePagePresenter is just a way to display a PDF page. The logic that will verify which printer should be used to print a specific page, as well as the implementation of the printing itself (showing the print dialog, setting the print settings, etc.) depends entirely on your implementation. We have not researched this issue as it is not directly related to the use of the control and cannot advise you on this topic.


All the best,
Kammen
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Jiri
Top achievements
Rank 1
answered on 27 Aug 2015, 03:47 PM

Hi Kammen,

I have now similar scenario, when I have downloaded more pdf files from DB (some byte[]) and now I want to print them in one batch.
I know how to use Silverlight's PrintDocument, but could you please elaborate more on how to use it with connection with Telerik's pdf components?

Thank you,
Jiri

0
Tanya
Telerik team
answered on 01 Sep 2015, 10:50 AM
Hi Jiri,

We've made some changes in the way presenters work in RadPdfViewer since 2012 and you could find more information about them in this article. Kamen's idea was to use the single page presenter as a way to pass the visuals to the printer since the presenter only shows one page at a time. In terms of code you can use the GoToPage() method to traverse all pages in the document.
this.pdfViewer.FixedDocumentPresenter = this.pdfViewer.GetRegisteredPresenter(FixedDocumentPresenterNames.FixedDocumentSinglePageViewPresenter);
...
(this.pdfViewer.FixedDocumentPresenter as FixedDocumentSinglePageViewPresenter).GoToPage(i);

As an alternative, if it is suitable for your scenario, you could use the API of RadPdfProcessing, which allows you to merge documents. The idea is to create a single document and use it to print all the documents at once. More information about how to achieve this is available in the RadFixedDocument article for RadPdfProcessing. Please, note that the RadFixedDocument class isn't completely unified at this point and you may find some differences between the library and the viewer.

Regards,
Tanya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
PDFViewer
Asked by
Lukas
Top achievements
Rank 1
Answers by
Kammen
Telerik team
Lukas
Top achievements
Rank 1
Jiri
Top achievements
Rank 1
Tanya
Telerik team
Share this question
or