diff --git a/src/pages/overview/pdf-services-api/howtos/create-pdf.md b/src/pages/overview/pdf-services-api/howtos/create-pdf.md
index 4fb5db5b0..6b55d946b 100644
--- a/src/pages/overview/pdf-services-api/howtos/create-pdf.md
+++ b/src/pages/overview/pdf-services-api/howtos/create-pdf.md
@@ -3,7 +3,7 @@ title: Create PDF | How Tos | PDF Services API | Adobe PDF Services
---
# Create PDF
-Create PDFs from a variety of formats, including static and dynamic HTML; Microsoft Word, PowerPoint, and Excel; as well as text, image, Zip, and URL. Support for HTML to PDF, DOC to PDF, DOCX to PDF, PPT to PDF, PPTX to PDF, XLS to PDF, XLSX to PDF, TXT to PDF, RTF to PDF, BMP to PDF, JPEG to PDF, GIF to PDF, TIFF to PDF, PNG to PDF
+Create PDFs from a variety of formats, including static and dynamic HTML; Microsoft Word, PowerPoint, and Excel; as well as text, image, Zip, and URL. Support for HTML to PDF, DOC to PDF, DOCX to PDF, PPT to PDF, PPTX to PDF, XLS to PDF, XLSX to PDF, TXT to PDF, MD to PDF, RTF to PDF, BMP to PDF, JPEG to PDF, GIF to PDF, TIFF to PDF, PNG to PDF
## REST API
@@ -24,7 +24,7 @@ following formats:
- Microsoft Word (DOC, DOCX)
- Microsoft PowerPoint (PPT, PPTX)
- Microsoft Excel (XLS, XLSX)
-- Text (TXT, RTF)
+- Text (TXT, RTF, MARKDOWN)
- Image (BMP, JPEG, GIF, TIFF, PNG)
diff --git a/src/pages/overview/pdf-services-api/howtos/export-pdf-form-data.md b/src/pages/overview/pdf-services-api/howtos/export-pdf-form-data.md
index 64ae33ab5..c5ea8148e 100644
--- a/src/pages/overview/pdf-services-api/howtos/export-pdf-form-data.md
+++ b/src/pages/overview/pdf-services-api/howtos/export-pdf-form-data.md
@@ -33,7 +33,7 @@ The sample below exports PDF form data and returns it as a JSON file.
Please refer to the [API usage guide](../api-usage.md) to understand how to use our APIs.
-
+
#### Java
@@ -79,6 +79,157 @@ public class ExportPDFFormData {
}
}
```
+#### .NET
+
+```javascript
+// Get the samples from https://www.adobe.com/go/pdftoolsapi_net_samples
+// Run the sample:
+// cd ExportPDFFormData/
+// dotnet run ExportPDFFormData.csproj
+
+namespace ExportPDFFormData
+{
+ class Program
+ {
+ private static readonly ILog log = LogManager.GetLogger(typeof(Program));
+
+ static void Main()
+ {
+ //Configure the logging
+ ConfigureLogging();
+ try
+ {
+ // Initial setup, create credentials instance
+ ICredentials credentials = new ServicePrincipalCredentials(
+ Environment.GetEnvironmentVariable("PDF_SERVICES_CLIENT_ID"),
+ Environment.GetEnvironmentVariable("PDF_SERVICES_CLIENT_SECRET"));
+
+ // Creates a PDF Services instance
+ PDFServices pdfServices = new PDFServices(credentials);
+
+ // Creates an asset(s) from source file(s) and upload
+ using Stream inputStream = File.OpenRead(@"exportPdfFormDataInput.pdf");
+ IAsset asset = pdfServices.Upload(inputStream, PDFServicesMediaType.PDF.GetMIMETypeValue());
+
+ // Creates a new job instance
+ ExportPDFFormDataJob exportPDFFormDataJob = new ExportPDFFormDataJob(asset);
+
+ // Submits the job and gets the job result
+ String location = pdfServices.Submit(exportPDFFormDataJob);
+ PDFServicesResponse pdfServicesResponse =
+ pdfServices.GetJobResult(location, typeof(ExportPDFFormDataResult));
+
+ // Get content from the resulting asset(s)
+ IAsset resultAsset = pdfServicesResponse.Result.Asset;
+ StreamAsset streamAsset = pdfServices.GetContent(resultAsset);
+
+ // Creating output streams and copying stream asset's content to it
+ String outputFilePath = CreateOutputFilePath();
+ new FileInfo(Directory.GetCurrentDirectory() + outputFilePath).Directory.Create();
+ Stream outputStream = File.OpenWrite(Directory.GetCurrentDirectory() + outputFilePath);
+ streamAsset.Stream.CopyTo(outputStream);
+ outputStream.Close();
+ }
+ catch (ServiceUsageException ex)
+ {
+ log.Error("Exception encountered while executing operation", ex);
+ }
+ catch (ServiceApiException ex)
+ {
+ log.Error("Exception encountered while executing operation", ex);
+ }
+ catch (SDKException ex)
+ {
+ log.Error("Exception encountered while executing operation", ex);
+ }
+ catch (IOException ex)
+ {
+ log.Error("Exception encountered while executing operation", ex);
+ }
+ catch (Exception ex)
+ {
+ log.Error("Exception encountered while executing operation", ex);
+ }
+ }
+
+ static void ConfigureLogging()
+ {
+ ILoggerRepository logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());
+ XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));
+ }
+ }
+}
+```
+
+#### Node JS
+
+```javascript
+// Get the samples from http://www.adobe.com/go/pdftoolsapi_node_sample
+// Run the sample:
+// node src/importpdfformdata/import-pdf-form-data.js
+
+const {
+ ServicePrincipalCredentials,
+ PDFServices,
+ MimeType,
+ ExportPDFFormDataJob,
+ ExportPDFFormDataResult,
+ SDKError,
+ ServiceUsageError,
+ ServiceApiError
+} = require("@adobe/pdfservices-node-sdk");
+const fs = require("fs");
+
+(async () => {
+ let readStream;
+ try {
+ // Initial setup, create credentials instance
+ const credentials = new ServicePrincipalCredentials({
+ clientId: process.env.PDF_SERVICES_CLIENT_ID,
+ clientSecret: process.env.PDF_SERVICES_CLIENT_SECRET
+ });
+
+ // Creates a PDF Services instance
+ const pdfServices = new PDFServices({credentials});
+
+ // Creates an asset(s) from source file(s) and uploads
+ readStream = fs.createReadStream("resources/exportPdfFormDataInput.pdf");
+ const inputAsset = await pdfServices.upload({
+ readStream,
+ mimeType: MimeType.PDF
+ });
+
+ // Creates a new job instance
+ const job = new ExportPDFFormDataJob({inputAsset});
+
+ // Submit the job and get the job result
+ const pollingURL = await pdfServices.submit({job});
+ const pdfServicesResponse = await pdfServices.getJobResult({
+ pollingURL,
+ resultType: ExportPDFFormDataResult
+ });
+
+ // Get content from the resulting asset(s)
+ const resultAsset = pdfServicesResponse.result.asset;
+ const streamAsset = await pdfServices.getContent({asset: resultAsset});
+
+ // Creates an output stream and copy stream asset's content to it
+ const outputFilePath = createOutputFilePath();
+ console.log(`Saving asset at ${outputFilePath}`);
+
+ const outputStream = fs.createWriteStream(outputFilePath);
+ streamAsset.readStream.pipe(outputStream);
+ } catch (err) {
+ if (err instanceof SDKError || err instanceof ServiceUsageError || err instanceof ServiceApiError) {
+ console.log("Exception encountered while executing operation", err);
+ } else {
+ console.log("Exception encountered while executing operation", err);
+ }
+ } finally {
+ readStream?.destroy();
+ }
+})();
+```
#### Python
diff --git a/src/pages/overview/pdf-services-api/howtos/import-pdf-form-data.md b/src/pages/overview/pdf-services-api/howtos/import-pdf-form-data.md
index 867cc4f94..567f269e2 100644
--- a/src/pages/overview/pdf-services-api/howtos/import-pdf-form-data.md
+++ b/src/pages/overview/pdf-services-api/howtos/import-pdf-form-data.md
@@ -33,7 +33,7 @@ The sample below demonstrates how to import form data from a JSON into PDF and g
Please refer to the [API usage guide](../api-usage.md) to understand how to use our APIs.
-
+
#### Java
@@ -94,6 +94,185 @@ public class ImportPdfFormData {
}
}
```
+#### .NET
+
+```javascript
+// Get the samples from https://www.adobe.com/go/pdftoolsapi_net_samples
+// Run the sample:
+// cd ImportPDFFormData/
+// dotnet run ImportPDFFormData.csproj
+
+namespace ImportPDFFormData
+{
+ class Program
+ {
+ private static readonly ILog log = LogManager.GetLogger(typeof(Program));
+
+ static void Main()
+ {
+ //Configure the logging
+ ConfigureLogging();
+ try
+ {
+ // Initial setup, create credentials instance
+ ICredentials credentials = new ServicePrincipalCredentials(
+ Environment.GetEnvironmentVariable("PDF_SERVICES_CLIENT_ID"),
+ Environment.GetEnvironmentVariable("PDF_SERVICES_CLIENT_SECRET"));
+
+ // Creates a PDF Services instance
+ PDFServices pdfServices = new PDFServices(credentials);
+
+ // Creates an asset(s) from source file(s) and upload
+ using Stream inputStream = File.OpenRead(@"importPdfFormDataInput.pdf");
+ IAsset asset = pdfServices.Upload(inputStream, PDFServicesMediaType.PDF.GetMIMETypeValue());
+
+ // Create parameters for the job
+ var formData = new JObject(
+ new JProperty("option_two", "Yes"),
+ new JProperty("option_one", "Yes"),
+ new JProperty("name", "sufia"),
+ new JProperty("option_three", "Off"),
+ new JProperty("age", "25"),
+ new JProperty("favorite_movie", "Star Wars Again")
+ );
+
+ ImportPDFFormDataParams importParams = ImportPDFFormDataParams.ImportPDFFormDataParamsBuilder()
+ .WithJsonFormFieldsData(formData)
+ .Build();
+
+ // Creates a new job instance
+ ImportPDFFormDataJob importPDFFormDataJob = new ImportPDFFormDataJob(asset);
+ importPDFFormDataJob.SetParams(importParams);
+
+ // Submits the job and gets the job result
+ String location = pdfServices.Submit(importPDFFormDataJob);
+ PDFServicesResponse pdfServicesResponse =
+ pdfServices.GetJobResult(location, typeof(ImportPDFFormDataResult));
+
+ // Get content from the resulting asset(s)
+ IAsset resultAsset = pdfServicesResponse.Result.Asset;
+ StreamAsset streamAsset = pdfServices.GetContent(resultAsset);
+
+ // Creating output streams and copying stream asset's content to it
+ String outputFilePath = CreateOutputFilePath();
+ new FileInfo(Directory.GetCurrentDirectory() + outputFilePath).Directory.Create();
+ Stream outputStream = File.OpenWrite(Directory.GetCurrentDirectory() + outputFilePath);
+ streamAsset.Stream.CopyTo(outputStream);
+ outputStream.Close();
+ }
+ catch (ServiceUsageException ex)
+ {
+ log.Error("Exception encountered while executing operation", ex);
+ }
+ catch (ServiceApiException ex)
+ {
+ log.Error("Exception encountered while executing operation", ex);
+ }
+ catch (SDKException ex)
+ {
+ log.Error("Exception encountered while executing operation", ex);
+ }
+ catch (IOException ex)
+ {
+ log.Error("Exception encountered while executing operation", ex);
+ }
+ catch (Exception ex)
+ {
+ log.Error("Exception encountered while executing operation", ex);
+ }
+ }
+
+ static void ConfigureLogging()
+ {
+ ILoggerRepository logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());
+ XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));
+ }
+ }
+}
+```
+
+#### Node JS
+
+```javascript
+// Get the samples from http://www.adobe.com/go/pdftoolsapi_node_sample
+// Run the sample:
+// node src/importpdfformdata/import-pdf-form-data.js
+
+const {
+ ServicePrincipalCredentials,
+ PDFServices,
+ MimeType,
+ ImportPDFFormDataJob,
+ ImportPDFFormDataResult,
+ ImportPDFFormDataParams,
+ SDKError,
+ ServiceUsageError,
+ ServiceApiError
+} = require("@adobe/pdfservices-node-sdk");
+const fs = require("fs");
+
+(async () => {
+ let readStream;
+ try {
+ // Initial setup, create credentials instance
+ const credentials = new ServicePrincipalCredentials({
+ clientId: process.env.PDF_SERVICES_CLIENT_ID,
+ clientSecret: process.env.PDF_SERVICES_CLIENT_SECRET
+ });
+
+ // Creates a PDF Services instance
+ const pdfServices = new PDFServices({credentials});
+
+ // Creates an asset(s) from source file(s) and uploads
+ readStream = fs.createReadStream("resources/importPdfFormDataInput.pdf");
+ const inputAsset = await pdfServices.upload({
+ readStream,
+ mimeType: MimeType.PDF
+ });
+
+ // Create parameters for the job
+ const params = new ImportPDFFormDataParams({
+ jsonFormFieldsData: {
+ "option_two": "Yes",
+ "option_one": "Off",
+ "name": "Supratim",
+ "option_three": "Off",
+ "age": "23",
+ "favorite_movie": "The Empire Strikes Back"
+ }
+ });
+
+ // Creates a new job instance
+ const job = new ImportPDFFormDataJob({ inputAsset, params });
+
+ // Submit the job and get the job result
+ const pollingURL = await pdfServices.submit({job});
+ const pdfServicesResponse = await pdfServices.getJobResult({
+ pollingURL,
+ resultType: ImportPDFFormDataResult
+ });
+
+ // Get content from the resulting asset(s)
+ const resultAsset = pdfServicesResponse.result.asset;
+ const streamAsset = await pdfServices.getContent({asset: resultAsset});
+
+ // Creates an output stream and copy stream asset's content to it
+ const outputFilePath = createOutputFilePath();
+ console.log(`Saving asset at ${outputFilePath}`);
+
+ const outputStream = fs.createWriteStream(outputFilePath);
+ streamAsset.readStream.pipe(outputStream);
+ } catch (err) {
+ if (err instanceof SDKError || err instanceof ServiceUsageError || err instanceof ServiceApiError) {
+ console.log("Exception encountered while executing operation", err);
+ } else {
+ console.log("Exception encountered while executing operation", err);
+ }
+ } finally {
+ readStream?.destroy();
+ }
+})();
+```
#### Python
diff --git a/src/pages/resources/openapi.json b/src/pages/resources/openapi.json
index 801cd9cb3..296a38893 100644
--- a/src/pages/resources/openapi.json
+++ b/src/pages/resources/openapi.json
@@ -2095,7 +2095,7 @@
"Create PDF"
],
"summary": "Create PDF document from non PDF document.",
- "description": "Create PDF document from Microsoft Office documents (Word, Excel and PowerPoint) and Image file formats.",
+ "description": "Create PDF document from Microsoft Office documents (Word, Excel and PowerPoint), Markdown and Image file formats.",
"operationId": "pdfoperations.createpdf",
"parameters": [
{
@@ -10016,7 +10016,7 @@
"type": "object",
"properties": {
"assetID": {
- "description": "A file assetID. Supported file formats are bmp, doc, docx, gif, jpeg, jpg, png, ppt, pptx, rtf, tif, tiff, txt, xls and xlsx. For more details click here .",
+ "description": "A file assetID. Supported file formats are bmp, doc, docx, gif, jpeg, jpg, md, png, ppt, pptx, rtf, tif, tiff, txt, xls and xlsx. For more details click here .",
"type": "string"
},
"documentLanguage": {
@@ -10609,6 +10609,11 @@
"type": "boolean",
"default": false
},
+ "includeRenderedHtml": {
+ "description": "When true, returns a ZIP containing both the generated PDF and the rendered HTML content.",
+ "type": "boolean",
+ "default": false
+ },
"pageLayout": {
"description": "Parameters for specifying the layout of the output page.",
"type": "object",
@@ -10642,6 +10647,7 @@
"assetID": "urn:aaid:AS:UE1:23c30ee0-2c4d-46d6-87f2-087832fca718",
"json": "{}",
"includeHeaderFooter": true,
+ "includeRenderedHtml": true,
"pageLayout": {
"pageWidth": 11,
"pageHeight": 8.5
@@ -10687,6 +10693,11 @@
"type": "boolean",
"default": false
},
+ "includeRenderedHtml": {
+ "description": "When true, returns a ZIP containing both the generated PDF and the rendered HTML content.",
+ "type": "boolean",
+ "default": false
+ },
"pageLayout": {
"description": "Parameters for specifying the layout of the output page.",
"type": "object",
@@ -10730,6 +10741,7 @@
"params": {
"json": "{\"k1\":\"v1\",\"k2\": \"v2\"}",
"includeHeaderFooter": true,
+ "includeRenderedHtml": true,
"pageLayout": {
"pageWidth": 8.5,
"pageHeight": 11