ViewSheet to PDF or byte array

ViewSheet to PDF or byte array

Anonymous
Not applicable
424 Views
2 Replies
Message 1 of 3

ViewSheet to PDF or byte array

Anonymous
Not applicable

I'm trying to export a ViewSheet to a PDF.  I already have a NuGet package to assist with the PDF aspect - Spire.Pdf - but the constructor takes either a Stream or a byte[ ] for arguments.  I figured the byte[ ] would be the easiest from a sheet, but I can't seem to find any functions within the ViewSheet class that can assist with this. 

 

I'm also 1000% open to using a separate NuGet package, or any other means to help convert a ViewSheet to a PDF.

 

Does anybody have any suggestions?  Thanks!!

425 Views
2 Replies
Replies (2)
Message 2 of 3

RPTHOMAS108
Mentor
Mentor

I'm aware of no such method that exports a byte array from a viewsheet, I'm not sure what form the data would be in?

 

I think you'll have to go down the batch printing route with a pdf print driver installed as part of your program. There is a postscript windows driver and various PS converters to pdf, since I believe PS is a close predecessor of PDF.

 

Windows 10 has a pdf writer but for some reason by default only plots to a size that can be printed by an actual printer rather than a virtual printer (which is odd). Even if the Windows 10 suited your needs in terms of size it still dislikes the setting of a print to file path meaning you have to do some Win32 hooks with the dialogue.

 

 

0 Likes
Message 3 of 3

Anonymous
Not applicable

I already have PDF drivers and the like in the project (Spire.PDF NuGet Package) for other purposes.  The my biggest problem and only problem at the moment is creating the PDF out of the ViewSheet.

0 Likes