Загрузка...

How to Convert Excel to PDF with Sheet Names as Bookmarks Using GemBox.Spreadsheet

Learn how to convert Excel sheets to PDF while including `sheet names as bookmarks` for easy navigation. This step-by-step guide will show you how to achieve this with GemBox.Spreadsheet and GemBox.Pdf.
---
This video is based on the question https://stackoverflow.com/q/68318368/ asked by the user 'bellpatricia' ( https://stackoverflow.com/u/8649053/ ) and on the answer https://stackoverflow.com/a/68342377/ provided by the user 'Mario Z' ( https://stackoverflow.com/u/2699178/ ) at 'Stack Overflow' website. Thanks to these great users and Stackexchange community for their contributions.

Visit these links for original content and any more details, such as alternate solutions, latest updates/developments on topic, comments, revision history etc. For example, the original title of the Question was: Convert Excel to PDF with sheet names as bookmarks

Also, Content (except music) licensed under CC BY-SA https://meta.stackexchange.com/help/licensing
The original Question post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/by-sa/4.0/ ) license, and the original Answer post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/by-sa/4.0/ ) license.

If anything seems off to you, please feel free to write me at vlogize [AT] gmail [DOT] com.
---
How to Convert Excel to PDF with Sheet Names as Bookmarks

Converting Excel files to PDF is a common task for many professionals, whether for reporting, sharing, or archiving data. However, adding an extra layer of usability, such as including the sheet names as bookmarks in the output PDF, can significantly enhance the user experience.

If you're currently using GemBox.Spreadsheet to handle your Excel files, you might be wondering how to implement this feature. While GemBox.Spreadsheet does not support bookmarks directly, it can be achieved by also using GemBox.Pdf.

In this post, we’ll walk you through the process of converting your Excel file into a PDF with the desired bookmarks.

Step 1: Prepare Your Environment

Ensure you have the following libraries installed in your project:

GemBox.Spreadsheet: For reading and saving Excel files.

GemBox.Pdf: For handling PDF-related functionalities.

You can install these libraries via NuGet if you haven't already:

[[See Video to Reveal this Text or Code Snippet]]

Step 2: Loading Your Excel File

First, you need to load your Excel file into your application. Below is a code snippet to help you get started:

[[See Video to Reveal this Text or Code Snippet]]

Step 3: Configure the Export Options

Depending on whether you want each Excel sheet as a single PDF page or as multiple pages, the approach will vary slightly.

Option A: Each Worksheet as a Single Page

If you want each worksheet exported as a single page in the PDF, configure the print options for each worksheet:

[[See Video to Reveal this Text or Code Snippet]]

Step 4: Save as a PDF and Add Bookmarks

Next, you’ll create a PDF document and add bookmarks for each sheet:

[[See Video to Reveal this Text or Code Snippet]]

Option B: Each Worksheet as Multiple Pages

If your sheets contain enough data that they will span multiple pages, the process is slightly different:

[[See Video to Reveal this Text or Code Snippet]]

Conclusion

Adding bookmarks for the sheet names when converting Excel files to PDF enhances usability significantly. With the above code snippets, you can easily manipulate your data and create organized, navigable PDF documents.

By following these steps using GemBox.Spreadsheet and GemBox.Pdf, you can streamline your workflow and ensure that readers can easily access each section of your PDF output.

Happy coding, and enjoy making your documents more user-friendly!

Видео How to Convert Excel to PDF with Sheet Names as Bookmarks Using GemBox.Spreadsheet канала vlogize
Страницу в закладки Мои закладки
Все заметки Новая заметка Страницу в заметки

На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.

Об использовании CookiesПринять