Print exception

2 posts, 0 answers
  1. Timothy
    Timothy avatar
    5 posts
    Member since:
    May 2013

    Posted 13 Mar 2014 Link to this post

    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...)

  2. Alexander
    Admin
    Alexander avatar
    41 posts

    Posted 18 Mar 2014 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top