开发者

Printing to PDF from Excel w/bookmarks

开发者 https://www.devze.com 2023-04-12 23:10 出处:网络
I\'m programmatically creating many sheets in an Excel workbook. When I\'m done I need to print the workbook to a pdf. That is working using this code

I'm programmatically creating many sheets in an Excel workbook. When I'm done I need to print the workbook to a pdf. That is working using this code

oBook.PrintOut(Type.Missing, Type.Missing, Type.Missing, Type开发者_高级运维.Missing, "Adobe PDF", true, Type.Missing, filename)
Process.Start(filename)

So, I print to postscript using the Adobe PDF printer instance and then open the .ps file to distill it. Everything works fine. What I need to do, however, is add bookmarks to the PDF file. All I need is the name of each sheet as a bookmark. Can I do that using the above method?

I know it can be done using the "Create PDF" option from Excel, which appears to use PDFMaker. Is there a way to call that from .NET?

Thanks for any help, I really appreciate it.

Thanks, Nick

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号