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

Export to PDF

1 Answer 157 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Mauricio Romo
Top achievements
Rank 2
Mauricio Romo asked on 29 Dec 2011, 01:12 AM
HI, I have a problem to export my document to PDF file radrichtexbox to the error shown is: "Operation is not valid due to the current state of the object".

This happens sometimes, it seems the problem is in the format that takes the document to put bullets.
My process for creating the PDF document is:

Try
ProviderPdf Dim As New PdfFormatProvider PdfFormatProvider = ()
Using output As Stream = File.Open (AppDomain.CurrentDomain.BaseDirectory & "\ temp \" & Label1.Content &. "Pdf", FileMode.Create)
providerPdf.Export (RadRichTextBox1.Document, output)
End Using
Catch ex As Exception
MsgBox (ex.ToString)
End Try

The stack trace is:
   
in Telerik.Windows.Documents.FormatProviders.Pdf.RadPdf.PdfFontPool.get_Item (Span span) in 54
   
in writer, Paragraph Paragraph, RectangleF rect) in 64
   
in writer, Paragraph paragraph) in 84
   
in sectionBox, PdfContentsWriter writer) in 283
   
in Telerik.Windows.Documents.FormatProviders.Pdf.PdfDocumentExporter.ExportPage (SectionLayoutBox sectionBox, PdfContentsWriter writer) in 343
   
in contentsWriter) in 375
   
in Telerik.Windows.Documents.FormatProviders.Pdf.RadPdf.PdfContents.WriteContents (pdfwrite writer) in 22
   
in Telerik.Windows.Documents.FormatProviders.Pdf.RadPdf.PdfStream.WriteToCore (pdfwrite writer) in 57
   
in Telerik.Windows.Documents.FormatProviders.Pdf.RadPdf.PdfObject.WriteTo (pdfwrite writer) in 42
   
in Telerik.Windows.Documents.FormatProviders.Pdf.RadPdf.PdfWriter.WritePdfObject (PdfObject obj) in 56
   
in Telerik.Windows.Documents.FormatProviders.Pdf.PdfDocumentExporter.Export () in 386
   
in Telerik.Windows.Documents.FormatProviders.Pdf.PdfFormatProvider.Export (RadDocument document, Stream output) at 56
   
in WPF_Dictado.Window1.parametrospdf () in C: \ Documents and Settings \ Administrator \ Desktop \ WPD_Dictado RIS \ WPF Dictation \ Window1.xaml.vb: line 1066

I would greatly appreciate the help I can provide. 

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 30 Dec 2011, 05:31 PM
Hi Mauricio,
We couldn't reproduce this exception. Maybe your problem is documents specific; can you export your document to XAML and send it back so we can examine the problem. You can attach the file to a support ticket.
Looking forward to your reply.

Greetings,
Martin
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
RichTextBox
Asked by
Mauricio Romo
Top achievements
Rank 2
Answers by
Martin Ivanov
Telerik team
Share this question
or