Printing Evelopes

4 posts, 0 answers
  1. Michael
    Michael avatar
    41 posts
    Member since:
    Oct 2010

    Posted 17 Aug 2013 Link to this post

    Hi,

    I am trying to use RadRichTextBox to print envelopes.  I have defined the proper page size and it looks good on the screen.  However, when I print, the text starts at the middle of the page and gets cut off. Below is my code for the RadRichTextBox.  I use standard RadRichTextBoxRibbonUI.

    Attached are 2 files: 
    (1) Scanned Envelope.jpg - I printed the envelope and then scanned it.  The text gets cut off.
    (2) PrintedToPdf.jpg - I printed to PDF Writer instead to printer.  Notice that the pages size seems to be incorrect.
    My guess, that page size is not being set properly when printing.  Any suggestions?

    <telerik:DocumentRuler Grid.Row="1">
        <telerik:RadRichTextBox x:Name="radRichTextBox" LayoutMode="Paged">
            <telerik:RadDocument>
                <telerik:Section PageOrientation="Landscape" PageMargin="25,25,25,25" PageSize="408, 912">
                    <telerik:Paragraph SpacingAfter="0">
                        <telerik:Span Text="Company Name"/>                               
                    </telerik:Paragraph>
                    <telerik:Paragraph SpacingAfter="0">
                        <telerik:Span Text="City, Province, Postal Code"/>
                    </telerik:Paragraph>
                    <telerik:Paragraph>
                        <telerik:Span Text="Country"/>
                    </telerik:Paragraph>
                    <telerik:Paragraph/>
                    <telerik:Paragraph/>
                    <telerik:Paragraph TextAlignment="Center" SpacingAfter="0">
                        <telerik:Span Text="Company Name"/>
                    </telerik:Paragraph>
                    <telerik:Paragraph TextAlignment="Center" SpacingAfter="0">
                        <telerik:Span Text="City, Province, Postal Code"/>
                    </telerik:Paragraph>
                    <telerik:Paragraph TextAlignment="Center" SpacingAfter="0">
                        <telerik:Span Text="Country"/>
                    </telerik:Paragraph>
                </telerik:Section>
            </telerik:RadDocument>
        </telerik:RadRichTextBox>
    </telerik:DocumentRuler>
  2. Petya
    Admin
    Petya avatar
    975 posts

    Posted 21 Aug 2013 Link to this post

    Hello Michael,

    What RadRichTextBox's printing functionality basically does is pass an image of the document to be printed to the printer. The printing itself is handled by the printer, so we have no control over the result.

    That said note that in order to properly print to No.10 Envelope paper you have to set this explicitly in the printer settings after the printing dialog is shown. The same applies for printing to PDF from a PDF creator.

    Additionally, we've noticed that XPS printers don't always respect settings such as margins, page size, etc. which is why we recommend testing with a PDF printer. I am also attaching a PDF file created from an application with the code you sent us.

    Let us know if you have further comments or questions.
     
    Regards,
    Petya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Michael
    Michael avatar
    41 posts
    Member since:
    Oct 2010

    Posted 21 Aug 2013 Link to this post

    Hello,

    Can you be more specific?  How do you set printer settings after the printing dialog is shown?  Print dialog is being called from within RadRichTextBox control.

    Thank you in advance.

    Michael
  5. Petya
    Admin
    Petya avatar
    975 posts

    Posted 22 Aug 2013 Link to this post

    Hello Michael,

    Please excuse me for not being clear enough.

    What I meant in my previous reply is that users will have to manually set the settings after the dialog opens.

    In general, you could try implementing this yourself. For example, the approach shown here seems to work as expected. Additionally, we will consider providing a way to set page size to the print dialog using RadRichTextBox's API in one of our future releases.

    I hope this helps!

    Regards,
    Petya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top