Mass Printing

6 posts, 0 answers
  1. Lukas
    Lukas avatar
    7 posts
    Member since:
    Sep 2012

    Posted 24 Sep 2012 Link to this post

    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
  2. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 25 Sep 2012 Link to this post

    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.

  3. DevCraft banner
  4. Lukas
    Lukas avatar
    7 posts
    Member since:
    Sep 2012

    Posted 25 Sep 2012 Link to this post

    Thank you for your answer.
    How would go about selecting the correct printing target? (e.g. Printer #1, PaperSource #2)
  5. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 26 Sep 2012 Link to this post

    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.

  6. Jiri
    Jiri avatar
    40 posts
    Member since:
    Oct 2013

    Posted 27 Aug 2015 in reply to Kammen Link to this post

    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

  7. Tanya
    Admin
    Tanya avatar
    405 posts

    Posted 01 Sep 2015 Link to this post

    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
Back to Top
DevCraft banner