Printing to PDF from Excel w/bookmarks

nickfinity

New Member
Joined
Feb 9, 2010
Messages
19
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 (C#)

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
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,203,144
Messages
6,053,738
Members
444,681
Latest member
Nadzri Hassan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top