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");