ByteArray to PDF
ByteArray to PDF
Hey,
I am trying to use the byte array from an uploaded pdf, to just print the pdf. Essentially the same issue that was listed in this post https://gdpicture.com/forum/viewtopic.php?t=1721
Did this ever get a solution? I specifically am wanting to print a pdf without first loading it into ImageViewer. I have the byte array, just need a way to print it or make a usable imageId out of it.
Thank you
I am trying to use the byte array from an uploaded pdf, to just print the pdf. Essentially the same issue that was listed in this post https://gdpicture.com/forum/viewtopic.php?t=1721
Did this ever get a solution? I specifically am wanting to print a pdf without first loading it into ImageViewer. I have the byte array, just need a way to print it or make a usable imageId out of it.
Thank you
Re: ByteArray to PDF
Hello Dylan,
Could you elaborate on your issue, please?
Does the oGdPictureImaging.CreateGdPictureImageFromByteArray() returns a 0?
Just to avoid any issue that was already corrected, could you update your GdPicture SDK to the latest version and tell me if the issue remains?
With best,
Fabio
Could you elaborate on your issue, please?
Does the oGdPictureImaging.CreateGdPictureImageFromByteArray() returns a 0?
Just to avoid any issue that was already corrected, could you update your GdPicture SDK to the latest version and tell me if the issue remains?
With best,
Fabio
Re: ByteArray to PDF
Yes, oGdPictureImaging.CreateGdPictureImageFromByteArray() returns a zero. The byte array represents a pdf that I am wanting to print, still as a pdf. I am using a version 14.0.0.7, where the post I linked was using 6.6. Has this functionality been added since then? Or does anyway exist to print a pdf without loading it into the viewer using a byte array?
Re: ByteArray to PDF
Hello Dylan,
This is expected that the oGdPictureImaging.CreateGdPictureImageFromByteArray() returns a zero if you give it a PDF as input.
The GdPictureImaging class is for raster images and GdPicturePDF for PDF.
Here is a code snippet I made for loading a byte array into a GdPicturePDF object:
And you will find all the information about the print process with a GdPicturePDF object here: https://www.gdpicture.com/guides/gdpict ... Print.html
By the way, it is recommended to update your GdPicture SDK (your current version was released the June 16th, 2017) if you face any issue, just to avoid old corrected bugs.
With best,
Fabio
This is expected that the oGdPictureImaging.CreateGdPictureImageFromByteArray() returns a zero if you give it a PDF as input.
The GdPictureImaging class is for raster images and GdPicturePDF for PDF.
Here is a code snippet I made for loading a byte array into a GdPicturePDF object:
Code: Select all
byte[] bytes = System.IO.File.ReadAllBytes(@"D:\Filesample.pdf");
GdPicturePDF oPdf = new GdPicturePDF();
MemoryStream ms = new MemoryStream(bytes);
oPdf.LoadFromStream(ms);
//oPdf.GetStat();
By the way, it is recommended to update your GdPicture SDK (your current version was released the June 16th, 2017) if you face any issue, just to avoid old corrected bugs.
With best,
Fabio
Re: ByteArray to PDF
Thanks Fabio! That code worked perfectly. I'll try to work on getting version updated for both of our sakes lolFabio wrote: ↑Thu Sep 30, 2021 4:50 pmHello Dylan,
This is expected that the oGdPictureImaging.CreateGdPictureImageFromByteArray() returns a zero if you give it a PDF as input.
The GdPictureImaging class is for raster images and GdPicturePDF for PDF.
Here is a code snippet I made for loading a byte array into a GdPicturePDF object:
And you will find all the information about the print process with a GdPicturePDF object here: https://www.gdpicture.com/guides/gdpict ... Print.htmlCode: Select all
byte[] bytes = System.IO.File.ReadAllBytes(@"D:\Filesample.pdf"); GdPicturePDF oPdf = new GdPicturePDF(); MemoryStream ms = new MemoryStream(bytes); oPdf.LoadFromStream(ms); //oPdf.GetStat();
By the way, it is recommended to update your GdPicture SDK (your current version was released the June 16th, 2017) if you face any issue, just to avoid old corrected bugs.
With best,
Fabio
Re: ByteArray to PDF
Hi Dylan,
I'm glad it suits you
Have a nice day,
Fabio
I'm glad it suits you
Have a nice day,
Fabio
Who is online
Users browsing this forum: No registered users and 1 guest