PDF Direct - Printing a PDF from a database/memory

// Expert user has replied.
E Efkan YILMAZ 3 years 5 months ago
68 1 0

Hello,
I'm developing using the Zebra.Printer.SDK Nuget package for .NET Core. I've successfully printed a PDF to our ZT230 using the library, however this was a PDF stored in the filesystem.
What we'd ideally like to do however is print from our PDF stores which are stored in an MSSQL database (or also sometimes just constructed in memory), so instead of the current
printer.SendFileContents("mypdf.pdf");
We'd ideally have something of the form
printer.SendFileContents(byte_array_containing_pdf);
Is this possible with the SDK or otherwise? Obviously I could write the PDFs out to a fileshare before printing, but it would be strongly preferable to avoid this step.
Thanks,
Calvin Southwood

Please Register or Login to post a reply

1 Replies

S Steven Si

The SendFileContents() is a convenient method for the application simply passing the filename and path to this API. It then reads the content of the file and sends the content to the printer one chunk at a time. If you prefer not to reconstruct the file, you can use the Connection.Write() API to send the content to the printer one chunk at a time. Hope this helps.

CONTACT
Can’t find what you’re looking for?