Render output

3 posts, 1 answers
  1. ManniAT
    ManniAT avatar
    885 posts
    Member since:
    Nov 2003

    Posted 23 Mar 2015 Link to this post


    I have a view which looks something like this:
        <Canvas Width="800" Height="1050" x:Name="caContent">
            <Image x:Name="imgBackground" Source="Images/Proto1.png" Stretch="UniformToFill" Width="800" Height="1050"/>

    At runtime I load a background image an after that I place controls (TextBlock) on the Canvas which are bound to data.
    So after all I have some kind of a report "printed" on the screen.
    I can also print this report (it's designed to fit on A4 paper format).

    Now my question - is there an easy way to save this report as PDF?

    I've seen your samples where FirstLook looked promising - but I had to learn that it displays an image "resultDocument...png" and not the data.
    And the "rendering code" is working with a "FixedContentEditor" and special rendering.

    My idea was that I can "print" to your PDF component like to a printer - or in other words - use the existing (for screen rendering) code and simply render the result to PDF.
    Is this possible?

    Thank you
  2. Answer
    Petya avatar
    983 posts

    Posted 24 Mar 2015 Link to this post

    Hi Manfred,

    RadPdfProcessing is a PDF document generation library, meaning it has no UI. With this in mind, it does support some utility classes and methods that allow to create the document in an easy manner, but they are not rendering engines.

    As to the specific scenario, I suggest you take a look at the documentation of the RadFixedDocumentEditor and FixedContentEditor classes. The first one allows generation of documents in a flow-like manner, e.g. adding table-like structures, paragraphs, images and so on. The latter is very similar but additionally exposes API for drawing geometries. So while the First Look and Bar Chart demos show images in their views, the funnel on the first one and the chart on the second are produced entirely with the API of the library and you could adopt a similar approach for your application.

    Also, we've considered exposing API allowing to convert a XAML visual tree to PDF and this is logged on the public portal here. You can vote for the functionality in order to increase its priority and follow it to be notified about any progress on the matter.

    I hope this helps.


    See What's Next in App Development. Register for TelerikNEXT.

  3. ManniAT
    ManniAT avatar
    885 posts
    Member since:
    Nov 2003

    Posted 24 Mar 2015 in reply to Petya Link to this post

    Hi Petya,

    ATM I found a solution by rendering my output to an image and add this to the PDF.
    Not perfect (no text selection - copy and so is available from the PDF) but as long as it has only to be a "printable content display" this works for me.

    Thank you for the precise answer
Back to Top