DisplayFromStream is Blank When Printing

Discussions about document viewing.
Post Reply
mdsweb
Posts: 9
Joined: Wed Jun 23, 2010 5:51 pm

DisplayFromStream is Blank When Printing

Post by mdsweb » Mon Oct 18, 2010 8:18 pm

Hello,

Using GdViewer, since updating to v7.1, when I open a particular image from a stream and attempt to print it -- it prints a completely blank page (there definitely being data in the stream that was passed to the GdViewer.

If I attempt to open the same data from a file and print it, it prints perfectly. If possible, however, I'd like to avoid writing this data to disk.

Code: Select all

 
                    FirmCover fc = FirmCover.OpenReferenceNumber(coverId);
                    PdfDocument doc = new PdfDocument();                //Create a new document.
                    PdfSection section = doc.Sections.Add();
                    PdfPage page = section.Pages.Add();
                    page = Barcode.GenerateCoverPage(page, fc);
                    doc.Save(@_sTempPath + @"\Cover" + fc.ReferenceId.ToString() + ".pdf");   // saves to disk
                
                    MemoryStream ms = new MemoryStream();
                    //doc.Save(ms);     // saving image to a memorystream did not work correctly in 7.1

                    GdPicture.GdViewer GdViewer1 = new GdPicture.GdViewer();
                    GdViewer1.SetLicenseNumber("xxx");
                    GdViewer1.DisplayFromFile(@_sTempPath + @"\Cover" + fc.ReferenceId.ToString() + ".pdf");   // load from file since memorystream load isnt working
                    //GdViewer1.DisplayFromStream(ms);   // old statement for loading from memorystream
                    //GdViewer1.DisplayFirstPage();
                    GdViewer1.Print();
                    GdViewer1.CloseDocument();
                    File.Delete(@_sTempPath + @"\Cover" + fc.ReferenceId.ToString() + ".pdf");

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: DisplayFromStream is Blank When Printing

Post by Loïc » Tue Oct 19, 2010 8:12 am

Hi,

We introduced a regression in 7.1 with stream loading. I am sorry for that, this will be fixed for 7.2.

Thank you for your comprehension,

Loïc

johnmcrin
Posts: 4
Joined: Tue Apr 17, 2012 5:37 pm

Re: DisplayFromStream is Blank When Printing

Post by johnmcrin » Tue Jul 03, 2012 11:13 pm

I think 7.2 has been launched since march 2012 am i right ????

SamiKharma
Posts: 352
Joined: Tue Sep 27, 2011 11:47 am

Re: DisplayFromStream is Blank When Printing

Post by SamiKharma » Wed Jul 04, 2012 12:03 am

Hi,

It has been launched way before that. We are now in V9.


Best Regards,
Sami Kharma
GdPicture Support

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest