Converting view/sheet to PrintDocument / printing custom papersize

Converting view/sheet to PrintDocument / printing custom papersize

j.buijs
Enthusiast Enthusiast
409 Views
0 Replies
Message 1 of 1

Converting view/sheet to PrintDocument / printing custom papersize

j.buijs
Enthusiast
Enthusiast

Hello,

 

For printing to PDF, I was wondering if there is any way to convert a view or sheet to a System.Windows.Printing.PrintDocument. Maybe exporting the view as a memorystream?

I wouldn't know where to start with that or if it's even possible.

 

I already have printing using the Revit API working using the PrintManager but I'd rather do all the PDF stuff in code so I don't have to depend on having a certain PDF printer driver installed.

 

Another thing is, I can't seem to get it working with a custom papersize.

If converting to a PrintDocument isn't possible, is there any good driver for printing any custom size?

I tried adding the papersize as a form using the Print Spooler API but that just seems way too complicated for a seemingly simple job.

 

Thanks in advance.

0 Likes
410 Views
0 Replies
Replies (0)