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

Printing Evelopes

3 Answers 160 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 17 Aug 2013, 08:00 PM
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>

3 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 21 Aug 2013, 12:00 PM
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 >>
0
Michael
Top achievements
Rank 1
answered on 21 Aug 2013, 04:01 PM
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
0
Petya
Telerik team
answered on 22 Aug 2013, 08:53 AM
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 >>
Tags
RichTextBox
Asked by
Michael
Top achievements
Rank 1
Answers by
Petya
Telerik team
Michael
Top achievements
Rank 1
Share this question
or