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

Print exception

1 Answer 35 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Timothy
Top achievements
Rank 1
Timothy asked on 13 Mar 2014, 02:36 PM
I can't figure out what the exact cause of this is. I have a wpf project which uses the RadPdfViewer. To Print I'm using the PrintPdfDocumentCommand. Running the project from visual studio (in debug or release) the pdf's print without a problem. When I publish the project and install it on my local machine I get an exception when trying to print. I click the "print" icon on the toolbar and the dialog window opens. I select my printer and click "print" on the dialog window, that is the program crashes from an exception (see stack trace below). The strange thing is, if the pdf file that is failing to print is in the same location as the programs executable it will print fine. This crash only happens when the pdf file's location is outside the directory of where the programs executable lives.  

StackTrace: System.ObjectDisposedException: Cannot access a closed file.
   at System.IO.__Error.FileNotOpen()
   at System.IO.FileStream.get_Position()
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfReader.Readers.PdfReaderBase.get_Position()
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfReader.Parsers.PdfParser.ReadIndirectObject(Int64 offset, Boolean isEncrypted)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfReader.PdfContentManager.ReadIndirectObject(IndirectReference fromRef, Boolean isEncrypted)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfReader.PdfContentManager.ReadData(IndirectReference reference)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfReader.PdfContentManager.ReadDataFromAsyncCall(IndirectReference reference)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfReader.PdfResourceManager.GetGlobalImageSource(ResourceKey key)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfReader.PdfResourceManager.GetImageSource(ResourceKey key)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.GetImageSource(ResourceKey key)
   at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.GetImageSource(Image image)
   at Telerik.Windows.Documents.Fixed.UI.ContentElementsPainter.DrawImage(DrawingContext drawingContext, ContentElementsPainterInitializeContext context, Image image)
   at Telerik.Windows.Documents.Fixed.UI.ContentElementsPainter.DrawImage(DrawingContext drawingContext, Image image)
   at Telerik.Windows.Documents.Fixed.UI.ContentElementsPainter.DrawContentElement(DrawingContext drawingContext, IContentElement contentElement)
   at Telerik.Windows.Documents.Fixed.UI.ContentElementsPainter.DrawContainer(DrawingContext drawingContext, Container container)
   at Telerik.Windows.Documents.Fixed.UI.ContentElementsPainter.DrawContentElement(DrawingContext drawingContext, IContentElement contentElement)
   at Telerik.Windows.Documents.Fixed.UI.ContentElementsPainter.DrawContainer(DrawingContext drawingContext, Container container)
   at Telerik.Windows.Documents.Fixed.UI.ContentElementsPainter.DrawContentElement(DrawingContext drawingContext, IContentElement contentElement)
   at Telerik.Windows.Documents.Fixed.UI.ContentElementsPainter.OnRender(DrawingContext dc)
   at System.Windows.UIElement.Arrange(Rect finalRect)
(cont...)

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 18 Mar 2014, 08:43 AM
Hello Timothy,

Thank you for contacting us.
We were not able to reproduce this issue. Could you send us a sample project which manages to reproduce this issue so we can examine it and determine what causes it ?

I'm looking forward to your reply.

Regards,
Alexander
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
Tags
PDFViewer
Asked by
Timothy
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or