Skip to content

Commit 2baa188

Browse files
Garvit KansalGarvit Kansal
authored andcommitted
Updating markdown as per linter checks
1 parent f5a5620 commit 2baa188

File tree

3 files changed

+169
-123
lines changed

3 files changed

+169
-123
lines changed

src/pages/overview/pdf-accessibility-auto-tag-api/gettingstarted.md

Lines changed: 45 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Getting Started | PDF Accessibility Auto-Tag API | Adobe PDF Services
33
---
44

5-
# Getting Started
5+
# Getting Started
66

77
<p>
88
PDF Accessibility Auto-Tag API assists in the process of improving accessibility in individual PDFs via auto-tagging, adding document structure tags to the PDF file that are used to read a document's text and presenting it in a way that makes sense to users using assistive technology. The API is accessible through SDKs which help you get up and running quickly. Once you've received your developer credential, download and set up one of the sample projects. After you're familiar with the APIs, leverage the samples in your own server-side code.
@@ -14,33 +14,34 @@ The SDK only supports server-based use cases where credentials are saved securel
1414

1515
## Step 1 : Getting the access token
1616

17-
PDF Services API endpoints are authenticated endpoints. Getting an access token is a two-step process :
17+
PDF Services API endpoints are authenticated endpoints. Getting an access token is a two-step process:
1818

1919
1. **Get Credentials** Invoking PDF Services API requires an Adobe-provided credential. To get one, [click here](https://acrobatservices.adobe.com/dc-integration-creation-app-cdn/main.html?api=pdf-services-api), and complete the workflow. Be sure to copy and save the credential values to a secure location.
20+
2021
2. **Retrieve Access Token** The PDF Services APIs require an access_token to authorize the request. Use the "Get AccessToken" API from the Postman Collection with your client_id, client_secret (mentioned in the pdfservices-api-credentials.json file downloaded in 1) to get the access_token OR directly use the below mentioned cURL to get the access_token.
2122

22-
<CodeBlock slots="heading, code" repeat="1" languages="REST API" />
23+
<CodeBlock slots="heading, code" repeat="1" languages="REST API"/>
2324

2425
### REST API
2526

26-
```javascript
27+
```bash
2728
curl --location 'https://pdf-services.adobe.io/token' \
2829
--header 'Content-Type: application/x-www-form-urlencoded' \
2930
--data-urlencode 'client_id={{Placeholder for Client ID}}' \
3031
--data-urlencode 'client_secret={{Placeholder for Client Secret}}'
3132
```
3233

33-
## Step 2 : Uploading an asset
34+
## Step 2 : Uploading an asset
3435

35-
After getting the access token, we need to upload the asset. Uploading an asset is a two-step process :
36+
After getting the access token, we need to upload the asset. Uploading an asset is a two-step process:
3637

3738
1. First you need to get an upload pre-signed URI by using the following API.
3839

3940
You can read more about the API in detail [here](../../../apis/#operation/asset.uploadpresignedurl).
4041

41-
<CodeBlock slots="heading, code" repeat="1" languages="REST API" />
42+
<CodeBlock slots="heading, code" repeat="1" languages="REST API" />
4243

43-
### REST API
44+
### REST API
4445

4546
```javascript
4647
curl --location --request POST 'https://pdf-services.adobe.io/assets' \
@@ -54,7 +55,7 @@ curl --location --request POST 'https://pdf-services.adobe.io/assets' \
5455

5556
2. On getting a `200` response status from the above API, use the `uploadUri` field in the response body of the above API to upload the asset directly to the cloud provider using a PUT API call. You will also get an `assetID` field which will be used in creating the job.
5657

57-
<CodeBlock slots="heading, code" repeat="1" languages="REST API" />
58+
<CodeBlock slots="heading, code" repeat="1" languages="REST API" />
5859

5960
### REST API
6061

@@ -64,19 +65,19 @@ curl --location -g --request PUT 'https://dcplatformstorageservice-prod-us-east-
6465
--data-binary '@{{Placeholder for file path}}'
6566
```
6667

67-
## Step 3 : Creating the job
68+
## Step 3 : Creating the job
6869

69-
To create a job for the operation, please use the `assetID` obtained in Step 2 in the API request body. On successful job submission you will get a status code of `201` and a response header `location` which will be used for polling.
70+
To create a job for the operation, please use the `assetID` obtained in Step 2 in the API request body. On successful job submission you will get a status code of `201` and a response header `location` which will be used for polling.
7071

7172
For creating the job, please refer to the corresponding API spec for the particular [PDF Operation](../../../apis).
7273

7374
## Step 4 : Fetching the status
7475

75-
Once the job is successfully created, you need to poll the at the `location` returned in response header of Step 3 by using the following API
76+
Once the job is successfully created, you need to poll the at the `location` returned in response header of Step 3 by using the following API
7677

7778
You can read more about the API in detail [here](../../../apis/#operation/pdfoperations.compresspdf.jobstatus).
7879

79-
<CodeBlock slots="heading, code" repeat="1" languages="REST API" />
80+
<CodeBlock slots="heading, code" repeat="1" languages="REST API" />
8081

8182
### REST API
8283

@@ -91,7 +92,7 @@ curl --location -g --request GET 'https://pdf-services.adobe.io/operation/compre
9192
Instead of using the status API to check the job status, you have the option to receive job completion notifications through Webhook. For more information, please refer the <a href="../../pdf-services-api/howtos/webhook-notification/">documentation</a>.
9293
</div>
9394

94-
## Step 5 : Downloading the asset
95+
## Step 5 : Downloading the asset
9596

9697
On getting `200` response code from the poll API, you will receive a `status` field in the response body which can either be `in progress`, `done` or `failed`.
9798

@@ -101,15 +102,15 @@ If the `status` field is `done` the response body will also have a download pre-
101102

102103
You can read more about the API in detail [here](../../../apis/#operation/asset.get).
103104

104-
<CodeBlock slots="heading, code" repeat="1" languages="REST API" />
105+
<CodeBlock slots="heading, code" repeat="1" languages="REST API" />
105106

106-
### REST API
107+
### REST API
107108

108109
```javascript
109110
curl --location -g --request GET 'https://dcplatformstorageservice-prod-us-east-1.s3-accelerate.amazonaws.com/b37fd583-1ab6-4f49-99ef-d716180b5de4?X-Amz-Security-Token={{Placeholder for X-Amz-Security-Token}}&X-Amz-Algorithm={{Placeholder for X-Amz-Algorithm}}&X-Amz-Date={{Placeholder for X-Amz-Date}}&X-Amz-SignedHeaders={{Placeholder for X-Amz-SignedHeaders}}&X-Amz-Expires={{Placeholder for X-Amz-Expires}}&X-Amz-Credential={{Placeholder for X-Amz-Credential}}&X-Amz-Signature={{Placeholder for X-Amz-Signature}}'
110111
```
111112

112-
## There you go! Your job is completed in 5 simple steps.
113+
## There you go! Your job is completed in 5 simple steps.
113114

114115
## SDK
115116

@@ -171,10 +172,10 @@ For clients using SDK version upto 2.x :
171172

172173
Jump start your development by bookmarking or downloading the following key resources:
173174

174-
- This document
175-
- [API reference (Javadoc)](https://www.adobe.com/go/pdftoolsapi_java_docs)
176-
- [Java Sample code](https://www.adobe.com/go/pdftoolsapi_java_samples)
177-
- [Java library](https://www.adobe.com/go/pdftoolsapi_java_maven). The Maven project contains the .jar file.
175+
1. This document
176+
2. [API reference (Javadoc)](https://www.adobe.com/go/pdftoolsapi_java_docs)
177+
3. [Java Sample code](https://www.adobe.com/go/pdftoolsapi_java_samples)
178+
4. [Java library](https://www.adobe.com/go/pdftoolsapi_java_maven). The Maven project contains the .jar file.
178179

179180
#### Authentication
180181

@@ -183,7 +184,7 @@ Once you complete the [Getting Credentials](https://documentservices.adobe.com/d
183184
- **Personalized Download**: Downloads the zip which contains `adobe-dc-pdf-services-sdk-java-samples` with a preconfigured `pdfservices-api-credentials.json` file.
184185
- **Non Personalized Download**: Downloads the `pdfservices-api-credentials.json` with your preconfigured credentials.
185186

186-
After downloading the zip, you can run the samples in the zip directly by setting up the two environment variables `PDF_SERVICES_CLIENT_ID` and `PDF_SERVICES_CLIENT_SECRET` by running the following cammands :
187+
After downloading the zip, you can run the samples in the zip directly by setting up the two environment variables `PDF_SERVICES_CLIENT_ID` and `PDF_SERVICES_CLIENT_SECRET` by running the following commands:
187188

188189
- **Windows:**
189190
- `set PDF_SERVICES_CLIENT_ID=<YOUR CLIENT ID>`
@@ -195,7 +196,7 @@ After downloading the zip, you can run the samples in the zip directly by settin
195196

196197
**Example pdfservices-api-credentials.json file**
197198

198-
```json
199+
```json
199200
{
200201
"client_credentials": {
201202
"client_id": "<YOUR_CLIENT_ID>",
@@ -245,10 +246,10 @@ Command line execution is not mandatory. You can import the samples Maven projec
245246

246247
For security reasons you may wish to confirm the installer's authenticity. To do so,
247248

248-
1. After installing the package, navigate to the `.jar.sha1` file.
249-
2. Calculate the hash with any 3rd party utility.
250-
3. Find and open PDF Services sha1 file. Note: if you're using Maven, look in the .m2 directory.
251-
4. Verify the hash you generated matches the value in the .sha1 file.
249+
1. After installing the package, navigate to the `.jar.sha1` file.
250+
2. Calculate the hash with any 3rd party utility.
251+
3. Find and open PDF Services sha1 file. Note: if you're using Maven, look in the .m2 directory.
252+
4. Verify the hash you generated matches the value in the .sha1 file.
252253

253254
```
254255
5d49322ced35a8195378a7ed297b4fb721780736
@@ -345,7 +346,7 @@ After downloading the zip, you can run the samples in the zip directly by settin
345346

346347
**Example pdfservices-api-credentials.json file**
347348

348-
```json
349+
```json
349350
{
350351
"client_credentials": {
351352
"client_id": "<YOUR_CLIENT_ID>",
@@ -456,7 +457,7 @@ After downloading the zip, you can run the samples in the zip directly by settin
456457

457458
**Example pdfservices-api-credentials.json file**
458459

459-
```json
460+
```json
460461
{
461462
"client_credentials": {
462463
"client_id": "<YOUR_CLIENT_ID>",
@@ -478,25 +479,33 @@ Running any sample or custom code requires the following steps:
478479

479480
The @adobe/pdfservices-node-sdk npm package automatically downloads when you build the sample project.
480481

481-
```
482+
```
482483
npm install --save @adobe/pdfservices-node-sdk
483484
```
484485

485486
##### Running the samples
486487

487488
The quickest way to get up and running is to download the code samples during the Getting Credentials workflow. These samples provide everything from ready-to-run sample code, an embedded credential json file, and pre-configured connections to dependencies.
488489

489-
1. Download [the Node.js sample project ](http://www.adobe.com/go/pdftoolsapi_node_sample).
490+
1. Download [the Node.js sample project](http://www.adobe.com/go/pdftoolsapi_node_sample).
490491
2. From the samples root directory, run `npm install`.
491-
3. Set the environment variables `PDF_SERVICES_CLIENT_ID` and `PDF_SERVICES_CLIENT_SECRET` by running the following commands :
492+
3. Set the environment variables `PDF_SERVICES_CLIENT_ID` and `PDF_SERVICES_CLIENT_SECRET` by running the following commands:
493+
492494
- **Windows:**
493495
- `set PDF_SERVICES_CLIENT_ID=<YOUR CLIENT ID>`
494496
- `set PDF_SERVICES_CLIENT_SECRET=<YOUR CLIENT SECRET>`
495497

496498
- **MacOS/Linux:**
497499
- `export PDF_SERVICES_CLIENT_ID=<YOUR CLIENT ID>`
498500
- `export PDF_SERVICES_CLIENT_SECRET=<YOUR CLIENT SECRET>`
501+
499502
4. Test the sample code on the command line.
503+
504+
```bash
505+
# Run the sample code
506+
node src/autotagpdf/autotag_pdf.js
507+
```
508+
500509
5. Refer to this document for details about running samples as well as the API Reference for API details.
501510

502511
#### Verifying download authenticity
@@ -538,7 +547,7 @@ The SDK uses the [log4js API](https://www.npmjs.com/package/log4js) for logging.
538547
"level": "info"
539548
}
540549
}
541-
}
550+
}
542551
```
543552

544553

@@ -579,7 +588,7 @@ After downloading the zip, you can run the samples in the zip directly by settin
579588

580589
**Example pdfservices-api-credentials.json file**
581590

582-
```json
591+
```json
583592
{
584593
"client_credentials": {
585594
"client_id": "<YOUR_CLIENT_ID>",
@@ -649,7 +658,7 @@ pip hash <download_dir>/pdfservices-sdk-4.2.0.tar.gz
649658

650659
###### To generate tagged PDF from the sample file
651660

652-
```javascript
661+
```javascript
653662
python src/autotagpdf/autotag_pdf.py
654663
```
655664

@@ -677,7 +686,7 @@ After downloading the zip, you can run the samples in the zip directly by settin
677686

678687
**Example pdfservices-api-credentials.json file**
679688

680-
```json
689+
```json
681690
{
682691
"client_credentials": {
683692
"client_id": "<YOUR_CLIENT_ID>",

0 commit comments

Comments
 (0)