Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation charts and extract schema #977

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,10 @@ module.exports = {
title: 'Hyperlink',
path: 'overview/document-generation-api/hyperlink.md'
},
{
title: 'Charts',
path: 'overview/document-generation-api/charts.md'
},
{
title: 'Inline Images',
path: 'overview/document-generation-api/inlineimages.md'
Expand Down
202 changes: 202 additions & 0 deletions src/pages/overview/document-generation-api/charts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
---
title: Charts | Document Generation API | Adobe PDF Services
---
# Charts

To dynamically insert a chart in the document, add the chart as placeholder and edit the chart and excel data.

## How It Works

To insert a chart in the document, add the chart as a placeholder in the document template. The chart placeholder is transformed into a chart in the output document by providing the chart data in the input JSON data.
The following types of graphs are supported:

- Column
- Line
- Pie

Steps to add chart in the document:

- **Open your Word document** and place the cursor where you want the chart to appear.
- **Go to the “Insert” tab** on the Ribbon.
- **Click on “Chart”** in the Illustrations group.
- **Choose the type of chart** you want from the list (e.g. column, line, pie) and click “OK”.
- An **Excel spreadsheet** will open with sample data. Replace this data with your own.
- **Close the Excel** window once you’ve entered your data. The chart in Word will update automatically.

![Edit chart data in Excel](../images/insert_chart_in_document.png)

## Line Chart

**Steps to insert a line chart in the document:**

- Add the line chart as a placeholder in the document template.

![PLaceholder for line chart](../images/placeholder_line_chart.png)

- Edit the chart data in the Excel by right click on chart and select "Edit Data in Excel".

![Edit chart data in Excel](../images/line_chart_excel.jpg)

**JSON representation of the input data:**

```json
{
"Title": "Sales Data",
"sales": [
{
"month": "January",
"phone": 1200,
"tablet": 800
},
{
"month": "February",
"phone": 1100,
"tablet": 750
},
{
"month": "March",
"phone": 1500,
"tablet": 900
},
{
"month": "April",
"phone": 1300,
"tablet": 850
},
{
"month": "May",
"phone": 1600,
"tablet": 950
},
{
"month": "June",
"phone": 1400,
"tablet": 900
},
{
"month": "July",
"phone": 1700,
"tablet": 1000
},
{
"month": "August",
"phone": 1800,
"tablet": 1100
},
{
"month": "September",
"phone": 1600,
"tablet": 1050
},
{
"month": "October",
"phone": 1900,
"tablet": 1150
},
{
"month": "November",
"phone": 2000,
"tablet": 1200
},
{
"month": "December",
"phone": 2100,
"tablet": 1250
}
]
}
```

**Output chart in document after processing.**

![Output of line chart in document](../images/line_chart_output.png)

## Column Chart


**Steps to insert a column chart in the document:**

- Add the column chart as a placeholder in the document template.

![PLaceholder for column chart](../images/placeholder_column_chart.png)

- Edit the chart data in the Excel by right click on chart and select "Edit Data in Excel".

![Edit chart data in Excel](../images/column_chart_excel.png)

**JSON representation of the input data:**

```json
{
"Title": "Vehicle Sales Data",
"sales": [
{
"month": "July",
"EV": 700000,
"ICE": 1500000
},
{
"month": "August",
"EV": 750000,
"ICE": 1450000
},
{
"month": "September",
"EV": 800000,
"ICE": 1400000
},
{
"month": "October",
"EV": 850000,
"ICE": 1350000
}
]
}

```

**Output chart in document after processing.**

![Output of line chart in document](../images/column_chart_output.png)

## Pie Chart

**Steps to insert a pie chart in the document:**

- Add the pie chart as a placeholder in the document template.

![PLaceholder for pie chart](../images/placeholder_column_chart.png)

- Edit the chart data in the Excel by right click on chart and select "Edit Data in Excel".

![Edit chart data in Excel](../images/pie_chart_excel.png)

**JSON representation of the input data:**

```json
{
"Title": "Car Sales by Quarters",
"carSales": [
{
"quarter": "1st Qtr",
"value": 1500
},
{
"quarter": "2nd Qtr",
"value": 2000
},
{
"quarter": "3rd Qtr",
"value": 1800
},
{
"quarter": "4th Qtr",
"value": 2200
}
]
}
```

**Output chart in document after processing.**

![Output of pie chart in document](../images/pie_chart_output.png)
Binary file added src/pages/overview/images/column_chart_excel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/pages/overview/images/column_chart_output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/pages/overview/images/line_chart_excel.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/pages/overview/images/line_chart_output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/pages/overview/images/pie_chart_excel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/pages/overview/images/pie_chart_output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion src/pages/overview/releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,14 @@ Upgrading to the latest SDK should not break existing applications.
## Change history


### November 14, 2024; Adobe Document Generation Server Side Release

- Adding support for charts in Document Generation API.

### November 06, 2024; Adobe Document Generation Server Side Release

- Restricting tag length to 1000 characters in the Document Generation API.


### November 06, 2024; Java SDK 4.2.0 and NodeJS, .NET, Python SDK 4.1.0 minor release

- PDF Watermark and PDF Accessibility Checker operations are now available for all the users in PDF Services SDKs.
Expand Down
4 changes: 4 additions & 0 deletions src/pages/resources/extractJSONOutputSchema2.json
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,10 @@
"items": {
"type": "string"
}
},
"alternate_text": {
"description": "Provides alternate text present in the input pdf structure mapped to the updated structure",
"type": "string"
}
},
"required": [
Expand Down
7 changes: 6 additions & 1 deletion src/pages/resources/extractJSONOutputSchemaStylingInfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,10 @@
"minItems": 1,
"items": {
"type": "string"
},
"alternate_text": {
"description": "Provides alternate text present in the input pdf structure mapped to the updated structure",
"type": "string"
}
},
"Kids": {
Expand Down Expand Up @@ -620,7 +624,8 @@
"Image",
"Reference",
"Kids",
"filePaths"
"filePaths",
"alternate_text"
]
}
},
Expand Down
4 changes: 4 additions & 0 deletions static/extractJSONOutputSchema2.json
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,10 @@
"items": {
"type": "string"
}
},
"alternate_text": {
"description": "Provides alternate text present in the input pdf structure mapped to the updated structure",
"type": "string"
}
},
"required": [
Expand Down
7 changes: 6 additions & 1 deletion static/extractJSONOutputSchemaStylingInfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,10 @@
"minItems": 1,
"items": {
"type": "string"
},
"alternate_text": {
"description": "Provides alternate text present in the input pdf structure mapped to the updated structure",
"type": "string"
}
},
"Kids": {
Expand Down Expand Up @@ -620,7 +624,8 @@
"Image",
"Reference",
"Kids",
"filePaths"
"filePaths",
"alternate_text"
]
}
},
Expand Down