> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/web/get-started/samples/showcase-demo-portfolio.md).

# Portfolio Showcase Demo Code Sample

Add support for PDF Portfolios (also known as PDF Packages), allowing users to view and edit each embedded file in its own dynamically generated tab.

{% hint style="info" %}
**Requirements**

*These packages are required to use these features in production. Trial keys have unlimited access to all features*

<a href="/web/get-started/readme.md" class="button primary">Web SDK</a><a href="/web/full-api/full-api-overview.md" class="button primary">Full API</a><a href="https://showcase.apryse.com/portfolio" class="button primary">Live demo</a>
{% endhint %}

Easily add support for PDF Portfolios (also known as PDF Packages), allowing users to view and edit each embedded file in its own dynamically generated tab. Attachments can be edited or downloaded individually. The viewer supports a wide range of file types within these portfolios, from Office documents to image formats.

This demo allows you to:

* Load a default PDF portfolio document with a set of attachments:
  * blank.pdf
  * demo-annotated.pdf
  * memo.docx
  * rendering.jpg
* Access options to view each attachment in its own tab (use "more options" `...` button on the right margin of the attachment).
* Edit each document and download separately.
* Load your own PDF portfolio to test the capabilities.

**Implementation steps** To add PDF portfolio support with WebViewer:

Step 1: Choose your [preferred web stack](/web/get-started/readme.md). Step 2: Add the ES6 JavaScript sample code provided in this guide.

Once you generate your license key, it will automatically be included in your sample code below.

{% @apryse-license-key/apryse-license-key platform="WEB\_VIEWER" variant="compact" %}

<pre class="language-js" data-line-numbers><code class="lang-js">// ES6 Compliant Syntax
// Copilot name: GitHub Copilot, version: 1.0.0, model: GPT-4, version: 2024-06, date: 2025-10-28
// File: showcase-demos/portfolio/index.js

import WebViewer from '@pdftron/webviewer';

const licenseKey = '<code class="expression">visitor.claims.wvKey || "YOUR_WEBVIEWER_LICENSE_KEY"</code>';

WebViewer(
  {
    path: '/lib',
    initialDoc: 'https://apryse.s3.us-west-1.amazonaws.com/public/files/samples/portfolio-sample.pdf',
    enableFilePicker: true, // Enable file picker to open files. In WebViewer -> menu icon -> Open File
    fullAPI: true, // Enable the PDF Portfolio
    licenseKey: licenseKey,
  },
  document.getElementById('viewer')
).then((instance) => {

  // Set the toolbar group to the Annotate tools
  instance.UI.setToolbarGroup('toolbarGroup-Annotate');

  // Enable the Portfolio feature
  instance.UI.enableFeatures([instance.UI.Feature.Portfolio]);

  // Open the left panel to show the Portfolio tab
  instance.UI.openElements(['tabPanel']);

  // Set the active left panel to the Portfolio panel when the document is loaded
  instance.Core.documentViewer.addEventListener('documentLoaded', () => {
    instance.UI.setActiveLeftPanel('portfolioPanel');
  });

  console.log('WebViewer loaded successfully.');
}).catch((error) => {
  console.error('Failed to initialize WebViewer:', error);
});
</code></pre>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/web/get-started/samples/showcase-demo-portfolio.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
