Sample C# code for using Apryse SDK to generate a PDF from an Office document template and a JSON string. Does not require any external dependencies or MS Office licenses. Learn more about our Server SDK and Office Template Generation.
1//
2// Copyright (c) 2001-2024 by Apryse Software Inc. All Rights Reserved.
3//
4
5using System;
6using System.Drawing;
7using System.Drawing.Drawing2D;
8
9using pdftron;
10using pdftron.Common;
11using pdftron.Filters;
12using pdftron.SDF;
13using pdftron.PDF;
14
15namespace OfficeTemplateTestCS
16{
17 /// <summary>
18 ///---------------------------------------------------------------------------------------
19 /// The following sample illustrates how to use the PDF::Convert utility class
20 /// to convert MS Office files to PDF and replace templated tags present in the document
21 /// with content supplied via json
22 ///
23 /// For a detailed specification of the template format and supported features,
24 /// see: https://docs.apryse.com/core/guides/generate-via-template/data-model/
25 ///
26 /// This conversion is performed entirely within the PDFNet and has *no* external or
27 /// system dependencies dependencies
28 ///
29 /// Please contact us if you have any questions.
30 ///---------------------------------------------------------------------------------------
31 /// </summary>
32
33
34
35 class Class1
36 {
37 private static pdftron.PDFNetLoader pdfNetLoader = pdftron.PDFNetLoader.Instance();
38 static Class1() { }
39
40 static String input_path = "../../../../TestFiles/";
41 static String output_path = "../../../../TestFiles/Output/";
42 static String json = "{\"dest_given_name\": \"Janice N.\", \"dest_street_address\": \"187 Duizelstraat\", \"dest_surname\": \"Symonds\", \"dest_title\": \"Ms.\", \"land_location\": \"225 Parc St., Rochelle, QC \"," +
43 "\"lease_problem\": \"According to the city records, the lease was initiated in September 2010 and never terminated\", \"logo\": {\"image_url\": \"" + input_path + "logo_red.png\", \"width\" : 64, \"height\" : 64}," +
44 "\"sender_name\": \"Arnold Smith\"}";
45
46 static String input_filename = "SYH_Letter.docx";
47 static String output_filename = "SYH_Letter.pdf";
48
49 /// <summary>
50 /// The main entry point for the application.
51 /// </summary>
52 static void Main(string[] args)
53 {
54 PDFNet.Initialize(PDFTronLicense.Key);
55
56 try
57 {
58 // Create a TemplateDocument object from an input office file.
59 using (TemplateDocument template_doc = pdftron.PDF.Convert.CreateOfficeTemplate(input_path + input_filename, null))
60 {
61 // Fill the template with data from a JSON string, producing a PDF document.
62 PDFDoc pdfdoc = template_doc.FillTemplateJson(json);
63
64 // Save the PDF to a file.
65 pdfdoc.Save(output_path + output_filename, SDFDoc.SaveOptions.e_linearized);
66
67 // And we're done!
68 Console.WriteLine("Saved " + output_filename);
69 }
70 }
71 catch (pdftron.Common.PDFNetException e)
72 {
73 Console.WriteLine(e.Message);
74 }
75 catch (Exception e)
76 {
77 Console.WriteLine("Unrecognized Exception: " + e.Message);
78 }
79
80 PDFNet.Terminate();
81 Console.WriteLine("Done.");
82 }
83 }
84}
1//------------------------------------------------------------------------------
2// Copyright (c) 2001-2024 by Apryse Software Inc. All Rights Reserved.
3// Consult legal.txt regarding legal and license information.
4//------------------------------------------------------------------------------
5
6#include <iostream>
7#include <PDF/PDFNet.h>
8#include <PDF/Convert.h>
9#include <PDF/OfficeToPDFOptions.h>
10#include "../../LicenseKey/CPP/LicenseKey.h"
11
12//------------------------------------------------------------------------------
13// The following sample illustrates how to use the PDF::Convert utility class
14// to convert MS Office files to PDF and replace templated tags present in the document
15// with content supplied via json
16//
17// For a detailed specification of the template format and supported features,
18// see: https://docs.apryse.com/core/guides/generate-via-template/data-model/
19//
20// This conversion is performed entirely within the PDFNet and has *no*
21// external or system dependencies -- Conversion results will be
22// the same whether on Windows, Linux or Android.
23//
24// Please contact us if you have any questions.
25//------------------------------------------------------------------------------
26
27using namespace pdftron;
28using namespace PDF;
29
30UString input_path = "../../TestFiles/";
31UString output_path = "../../TestFiles/Output/";
32
33
34int main(int argc, char *argv[])
35{
36 // The first step in every application using PDFNet is to initialize the
37 // library. The library is usually initialized only once, but calling
38 // Initialize() multiple times is also fine.
39 int ret = 0;
40
41 PDFNet::Initialize(LicenseKey);
42 PDFNet::SetResourcesPath("../../../Resources");
43
44 UString input_filename = "SYH_Letter.docx";
45 UString output_filename = "SYH_Letter.pdf";
46
47 UString json(
48 "{\"dest_given_name\": \"Janice N.\", \"dest_street_address\": \"187 Duizelstraat\", \"dest_surname\": \"Symonds\", \"dest_title\": \"Ms.\", \"land_location\": \"225 Parc St., Rochelle, QC \","
49 "\"lease_problem\": \"According to the city records, the lease was initiated in September 2010 and never terminated\", \"logo\": {\"image_url\": \"" + input_path + "logo_red.png\", \"width\" : 64, \"height\" : 64},"
50 "\"sender_name\": \"Arnold Smith\"}"
51 );
52
53 try
54 {
55 // Create a TemplateDocument object from an input office file.
56 TemplateDocument template_doc = Convert::CreateOfficeTemplate(input_path + input_filename, NULL);
57
58 // Fill the template with data from a JSON string, producing a PDF document.
59 PDFDoc pdf = template_doc.FillTemplateJson(json);
60
61 // Save the PDF to a file.
62 pdf.Save(output_path + output_filename, SDF::SDFDoc::e_linearized, NULL);
63
64 // And we're done!
65 std::cout << "Saved " << output_filename << std::endl;
66 }
67 catch (Common::Exception& e)
68 {
69 std::cout << e << std::endl;
70 ret = 1;
71 }
72 catch (...)
73 {
74 std::cout << "Unknown Exception" << std::endl;
75 ret = 1;
76 }
77
78 PDFNet::Terminate();
79 std::cout << "Done.\n";
80 return ret;
81}
1//---------------------------------------------------------------------------------------
2// Copyright (c) 2001-2021 by PDFTron Systems Inc. All Rights Reserved.
3// Consult LICENSE.txt regarding license information.
4//---------------------------------------------------------------------------------------
5
6package main
7import (
8 "fmt"
9 . "pdftron"
10)
11
12import "pdftron/Samples/LicenseKey/GO"
13
14//------------------------------------------------------------------------------
15// The following sample illustrates how to use ConvertOfficeToPDF
16// to convert MS Office files to PDF and replace templated tags present in the document
17// with content supplied via json
18//
19// For a detailed specification of the template format and supported features,
20// see: https://docs.apryse.com/core/guides/generate-via-template/data-model/
21//
22// This conversion is performed entirely within the PDFNet and has *no*
23// external or system dependencies -- Conversion results will be
24// the same whether on Windows, Linux or Android.
25//
26// Please contact us if you have any questions.
27//------------------------------------------------------------------------------
28
29// Relative path to the folder containing the test files.
30var inputPath = "../../TestFiles/"
31var outputPath = "../../TestFiles/Output/"
32
33func main(){
34 // The first step in every application using PDFNet is to initialize the
35 // library. The library is usually initialized only once, but calling
36 // Initialize() multiple times is also fine.
37 PDFNetInitialize(PDFTronLicense.Key)
38 PDFNetSetResourcesPath("../../Resources")
39
40 var inputFileName = "SYH_Letter.docx"
41 var outputFileName = "SYH_Letter.pdf"
42 var json = `
43 {
44 "dest_given_name": "Janice N.",
45 "dest_street_address": "187 Duizelstraat",
46 "dest_surname": "Symonds",
47 "dest_title": "Ms.",
48 "land_location": "225 Parc St., Rochelle, QC ",
49 "lease_problem": "According to the city records, the lease was initiated in September 2010 and never terminated",
50 "logo": { "image_url": "` + inputPath + `logo_red.png", "width" : 64, "height": 64 },
51 "sender_name": "Arnold Smith"
52 }`;
53
54 options := NewOfficeToPDFOptions()
55
56 options.SetTemplateParamsJson(json)
57
58 // Start with a PDFDoc (the conversion destination)
59 pdfdoc := NewPDFDoc()
60
61 // perform the conversion with template delimiters and content dictionary
62 ConvertOfficeToPDF(pdfdoc, inputPath + inputFileName, options)
63
64 // save the result
65 pdfdoc.Save(outputPath + outputFileName, uint(SDFDocE_linearized))
66
67 // And we're done!
68 fmt.Println("Saved " + outputFileName )
69}
1//---------------------------------------------------------------------------------------
2// Copyright (c) 2001-2024 by Apryse Software Inc. All Rights Reserved.
3// Consult legal.txt regarding legal and license information.
4//---------------------------------------------------------------------------------------
5
6import com.pdftron.common.PDFNetException;
7import com.pdftron.pdf.Convert;
8import com.pdftron.pdf.TemplateDocument;
9import com.pdftron.pdf.PDFDoc;
10import com.pdftron.pdf.PDFNet;
11import com.pdftron.pdf.OfficeToPDFOptions;
12import com.pdftron.sdf.SDFDoc;
13
14//---------------------------------------------------------------------------------------
15// The following sample illustrates how to use the PDF::Convert utility class
16// to convert MS Office files to PDF and replace templated tags present in the document
17// with content supplied via json
18//
19// For a detailed specification of the template format and supported features,
20// see: https://docs.apryse.com/core/guides/generate-via-template/data-model/
21//
22// This conversion is performed entirely within the PDFNet and has *no* external or
23// system dependencies dependencies -- Conversion results will be the same whether
24// on Windows, Linux or Android.
25//
26// Please contact us if you have any questions.
27//---------------------------------------------------------------------------------------
28public class OfficeTemplateTest {
29
30 static String input_path = "../../TestFiles/";
31 static String output_path = "../../TestFiles/Output/";
32 static String input_filename = "SYH_Letter.docx";
33 static String output_filename = "SYH_Letter.pdf";
34
35 public static void main(String[] args) {
36 PDFNet.initialize(PDFTronLicense.Key());
37 PDFNet.setResourcesPath("../../../Resources");
38
39 try {
40 String json = new StringBuilder()
41 .append("{\"dest_given_name\": \"Janice N.\", \"dest_street_address\": \"187 Duizelstraat\", \"dest_surname\": \"Symonds\", \"dest_title\": \"Ms.\", \"land_location\": \"225 Parc St., Rochelle, QC \",")
42 .append("\"lease_problem\": \"According to the city records, the lease was initiated in September 2010 and never terminated\", \"logo\": {\"image_url\": \"" + input_path + "logo_red.png\", \"width\" : 64, \"height\" : 64},")
43 .append("\"sender_name\": \"Arnold Smith\"}").toString();
44
45 // Create a TemplateDocument object from an input office file.
46 TemplateDocument template_doc = Convert.createOfficeTemplate(input_path + input_filename, null);
47
48 // Fill the template with data from a JSON string, producing a PDF document.
49 try (PDFDoc pdfdoc = template_doc.fillTemplateJson(json)) {
50
51 // Save the PDF to a file.
52 pdfdoc.save(output_path + output_filename, SDFDoc.SaveMode.INCREMENTAL, null);
53 }
54 }
55 catch (PDFNetException e) {
56 e.printStackTrace();
57 System.out.println(e);
58 }
59
60 // And we're done!
61 System.out.println("Saved " + output_filename);
62 System.out.println("Done.");
63
64 PDFNet.terminate();
65 }
66
67}
1//---------------------------------------------------------------------------------------
2// Copyright (c) 2001-2024 by Apryse Software Inc. All Rights Reserved.
3// Consult legal.txt regarding legal and license information.
4//---------------------------------------------------------------------------------------
5
6//------------------------------------------------------------------------------
7// The following sample illustrates how to use the PDF::Convert utility class
8// to convert MS Office files to PDF and replace templated tags present in the document
9// with content supplied via json
10//
11// For a detailed specification of the template format and supported features,
12// see: https://docs.apryse.com/core/guides/generate-via-template/data-model/
13//
14// This conversion is performed entirely within the PDFNet and has *no*
15// external or system dependencies -- Conversion results will be
16// the same whether on Windows, Linux or Android.
17//
18// Please contact us if you have any questions.
19//------------------------------------------------------------------------------
20
21const { PDFNet } = require('@pdftron/pdfnet-node');
22const PDFTronLicense = require('../LicenseKey/LicenseKey');
23
24((exports) => {
25 'use strict';
26
27 exports.runOfficeTemplateTest = () => {
28
29 const inputPath = '../TestFiles/';
30 const outputPath = inputPath + 'Output/';
31 const inputFilename = 'SYH_Letter.docx'
32 const outputFilename = 'SYH_Letter.pdf'
33
34 const main = async () => {
35
36 PDFNet.addResourceSearchPath('../Resources');
37
38 try {
39 const options = new PDFNet.Convert.OfficeToPDFOptions();
40
41 const json = JSON.stringify({
42 'dest_given_name': 'Janice N.',
43 'dest_street_address': "187 Duizelstraat",
44 'dest_surname': 'Symonds',
45 'dest_title': 'Ms.',
46 'land_location': '225 Parc St., Rochelle, QC ',
47 'lease_problem': 'According to the city records, the lease was initiated in September 2010 and never terminated',
48 'logo': { 'image_url': inputPath + 'logo_red.png', 'width' : 64, 'height': 64 },
49 'sender_name': 'Arnold Smith'
50 });
51
52 // Create a TemplateDocument object from an input office file.
53 const templateDoc = await PDFNet.Convert.createOfficeTemplateWithPath(inputPath + inputFilename, options);
54
55 // Fill the template with data from a JSON string, producing a PDF document.
56 const pdfdoc = await templateDoc.fillTemplateJson(json);
57
58 // Save the PDF to a file.
59 await pdfdoc.save(outputPath + outputFilename, PDFNet.SDFDoc.SaveOptions.e_linearized);
60
61 // And we're done!
62 console.log('Saved ' + outputFilename);
63
64 } catch (err) {
65 console.log(err);
66 }
67
68 console.log('Done.');
69 };
70
71 PDFNet.runWithCleanup(main, PDFTronLicense.Key).catch(function (error) {
72 console.log('Error: ' + JSON.stringify(error));
73 }).then(function () { return PDFNet.shutdown(); });
74
75 };
76 exports.runOfficeTemplateTest();
77})(exports);
78// eslint-disable-next-line spaced-comment
79//# sourceURL=OfficeTemplateTest.js
1<?php
2//------------------------------------------------------------------------------
3// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
4// Consult legal.txt regarding legal and license information.
5//------------------------------------------------------------------------------
6if(file_exists("../../../PDFNetC/Lib/PDFNetPHP.php"))
7include("../../../PDFNetC/Lib/PDFNetPHP.php");
8include("../../LicenseKey/PHP/LicenseKey.php");
9
10// Relative path to the folder containing the test files.
11$input_path = getcwd()."/../../TestFiles/";
12$output_path = $input_path."Output/";
13
14//------------------------------------------------------------------------------
15// The following sample illustrates how to use the PDF::Convert utility class
16// to convert MS Office files to PDF and replace templated tags present in the document
17// with content supplied via json
18//
19// For a detailed specification of the template format and supported features,
20// see: https://docs.apryse.com/core/guides/generate-via-template/data-model/
21//
22// This conversion is performed entirely within the PDFNet and has *no*
23// external or system dependencies -- Conversion results will be
24// the same whether on Windows, Linux or Android.
25//
26// Please contact us if you have any questions.
27//------------------------------------------------------------------------------
28
29function main()
30{
31 // The first step in every application using PDFNet is to initialize the
32 // library. The library is usually initialized only once, but calling
33 // Initialize() multiple times is also fine.
34 global $LicenseKey;
35 PDFNet::Initialize($LicenseKey);
36 PDFNet::SetResourcesPath("../../../Resources");
37
38 global $input_path, $output_path;
39 $input_filename = 'SYH_Letter.docx';
40 $output_filename = 'SYH_Letter.pdf';
41
42 $json = '
43 {
44 "dest_given_name": "Janice N.",
45 "dest_street_address": "187 Duizelstraat",
46 "dest_surname": "Symonds",
47 "dest_title": "Ms.",
48 "land_location": "225 Parc St., Rochelle, QC ",
49 "lease_problem": "According to the city records, the lease was initiated in September 2010 and never terminated",
50 "logo": { "image_url": "' . $input_path . 'logo_red.png", "width" : 64, "height": 64 },
51 "sender_name": "Arnold Smith"
52 }';
53
54 // Create a TemplateDocument object from an input office file.
55 $template_doc = Convert::CreateOfficeTemplate($input_path . $input_filename, NULL);
56
57 // Fill the template with data from a JSON string, producing a PDF document.
58 $pdfdoc = $template_doc->FillTemplateJson($json);
59
60 // Save the PDF to a file.
61 $pdfdoc->Save($output_path.$output_filename, SDFDoc::e_linearized);
62
63 // And we're done!
64 echo nl2br("Saved ".$output_filename . "\n");
65 echo nl2br("Done.\n");
66}
67
68main()
69
70?>
1#---------------------------------------------------------------------------------------
2# Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
3# Consult LICENSE.txt regarding license information.
4#---------------------------------------------------------------------------------------
5
6import site
7site.addsitedir("../../../PDFNetC/Lib")
8import sys
9from PDFNetPython import *
10
11sys.path.append("../../LicenseKey/PYTHON")
12from LicenseKey import *
13
14# Relative path to the folder containing the test files.
15input_path = "../../TestFiles/"
16output_path = "../../TestFiles/Output/"
17
18#------------------------------------------------------------------------------
19# The following sample illustrates how to use the PDF.Convert utility class
20# to convert MS Office files to PDF and replace templated tags present in the document
21# with content supplied via json
22#
23# For a detailed specification of the template format and supported features,
24# see: https://docs.apryse.com/core/guides/generate-via-template/data-model/
25#
26# This conversion is performed entirely within the PDFNet and has *no*
27# external or system dependencies -- Conversion results will be
28# the same whether on Windows, Linux or Android.
29#
30# Please contact us if you have any questions.
31#------------------------------------------------------------------------------
32
33def main():
34 # The first step in every application using PDFNet is to initialize the
35 # library. The library is usually initialized only once, but calling
36 # Initialize() multiple times is also fine.
37 PDFNet.Initialize(LicenseKey)
38 PDFNet.SetResourcesPath("../../../Resources")
39
40 input_filename = "SYH_Letter.docx"
41 output_filename = "SYH_Letter.pdf"
42
43 json = """
44 {{
45 "dest_given_name": "Janice N.",
46 "dest_street_address": "187 Duizelstraat",
47 "dest_surname": "Symonds",
48 "dest_title": "Ms.",
49 "land_location": "225 Parc St., Rochelle, QC ",
50 "lease_problem": "According to the city records, the lease was initiated in September 2010 and never terminated",
51 "logo": {{ "image_url": "{0}logo_red.png", "width" : 64, "height": 64 }},
52 "sender_name": "Arnold Smith"
53 }}
54 """.format(input_path)
55
56 # Create a TemplateDocument object from an input office file.
57 template_doc = Convert.CreateOfficeTemplate(input_path + input_filename, None)
58
59 # Fill the template with data from a JSON string, producing a PDF document.
60 pdfdoc = template_doc.FillTemplateJson(json);
61
62 # Save the PDF to a file.
63 pdfdoc.Save(output_path + output_filename, SDFDoc.e_linearized)
64
65 # And we're done!
66 print("Saved " + output_filename )
67 print("Done.")
68
69if __name__ == '__main__':
70 main()
1#---------------------------------------------------------------------------------------
2# Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
3# Consult LICENSE.txt regarding license information.
4#---------------------------------------------------------------------------------------
5
6require '../../../PDFNetC/Lib/PDFNetRuby'
7include PDFNetRuby
8require '../../LicenseKey/RUBY/LicenseKey'
9
10$stdout.sync = true
11
12#------------------------------------------------------------------------------
13# The following sample illustrates how to use the PDF.Convert utility class
14# to convert MS Office files to PDF and replace templated tags present in the document
15# with content supplied via json
16#
17# For a detailed specification of the template format and supported features,
18# see: https://docs.apryse.com/core/guides/generate-via-template/data-model/
19#
20# This conversion is performed entirely within the PDFNet and has *no*
21# external or system dependencies -- Conversion results will be
22# the same whether on Windows, Linux or Android.
23#
24# Please contact us if you have any questions.
25#------------------------------------------------------------------------------
26
27# Relative path to the folder containing the test files.
28$inputPath = "../../TestFiles/"
29$outputPath = "../../TestFiles/Output/"
30
31def main()
32 # The first step in every application using PDFNet is to initialize the
33 # library. The library is usually initialized only once, but calling
34 # Initialize() multiple times is also fine.
35 PDFNet.Initialize(PDFTronLicense.Key)
36 PDFNet.SetResourcesPath("../../../Resources")
37
38 inputFilename = "SYH_Letter.docx"
39 outputFilename = "SYH_Letter.pdf"
40
41 json = '
42 {
43 "dest_given_name": "Janice N.",
44 "dest_street_address": "187 Duizelstraat",
45 "dest_surname": "Symonds",
46 "dest_title": "Ms.",
47 "land_location": "225 Parc St., Rochelle, QC ",
48 "lease_problem": "According to the city records, the lease was initiated in September 2010 and never terminated",
49 "logo": { "image_url": "%slogo_red.png", "width" : 64, "height": 64 },
50 "sender_name": "Arnold Smith"
51 }
52 ' % $inputPath
53
54 # Create a TemplateDocument object from an input office file.
55 inputFile = $inputPath + inputFilename
56 templateDoc = Convert.CreateOfficeTemplate(inputFile, nil)
57
58 # Fill the template with data from a JSON string, producing a PDF document.
59 pdfdoc = templateDoc.FillTemplateJson(json)
60
61 # Save the PDF to a file.
62 outputFile = $outputPath + outputFilename
63 pdfdoc.Save(outputFile, SDFDoc::E_linearized)
64
65 # And we're done!
66 puts "Saved " + outputFilename
67 puts "Done."
68end
69
70main()
1'
2' Copyright (c) 2001-2024 by Apryse Software Inc. All Rights Reserved.
3'
4
5Imports pdftron
6Imports pdftron.Common
7Imports System.Text
8Imports pdftron.SDF
9Imports pdftron.PDF
10
11
12' The following sample illustrates how to use the PDF::Convert utility class to convert
13' .docx files to PDF and replace templated tags present in the document with content supplied via json
14'
15' For a detailed specification of the template format and supported features,
16' see: https://docs.apryse.com/core/guides/generate-via-template/data-model/
17'
18' This conversion is performed entirely within the PDFNet and has *no* external or
19' system dependencies dependencies
20'
21' Please contact us if you have any questions.
22Module OfficeToPDFTestVB
23 Dim pdfNetLoader As PDFNetLoader
24 Sub New()
25 pdfNetLoader = pdftron.PDFNetLoader.Instance()
26 End Sub
27
28 ' Relative path to the folder containing test files.
29 Dim input_path As String = "../../../../TestFiles/"
30 Dim output_path As String = "../../../../TestFiles/Output/"
31 Dim input_filename As String = "SYH_Letter.docx"
32 Dim output_filename As String = "SYH_Letter.pdf"
33
34 Sub Main()
35
36 PDFNet.Initialize(PDFTronLicense.Key)
37
38 Try
39 ' Create a TemplateDocument object from an input office file.
40 Using template_doc as TemplateDocument = pdftron.PDF.Convert.CreateOfficeTemplate(input_path + input_filename, Nothing)
41 Dim builder As New StringBuilder()
42 builder.Append("{""dest_given_name"": ""Janice N."", ""dest_street_address"": ""187 Duizelstraat"", ""dest_surname"": ""Symonds"", ""dest_title"": ""Ms."", ""land_location"": ""225 Parc St., Rochelle, QC "",")
43 builder.Append("""lease_problem"":""According to the city records, the lease was initiated in September 2010 and never terminated"", ""logo"": {""image_url"": """ + input_path + "logo_red.png"", ""width"" : 64, ""height"" : 64},")
44 builder.Append("""sender_name"": ""Arnold Smith""}")
45 Dim json As String = builder.ToString()
46
47 ' Fill the template with data from a JSON string, producing a PDF document.
48 Dim pdfdoc As PDFDoc = template_doc.FillTemplateJson(json)
49
50 ' Save the PDF to a file.
51 pdfdoc.Save(output_path + output_filename, SDFDoc.SaveOptions.e_linearized)
52
53 ' And we're done!
54 Console.WriteLine("Saved " + output_filename)
55 Console.WriteLine("Done.")
56 End Using
57
58 Catch ex As PDFNetException
59
60 Console.WriteLine(ex.Message)
61
62 Catch ex As Exception
63
64 MsgBox(ex.Message)
65
66 End Try
67
68 PDFNet.Terminate()
69
70 End Sub
71
72End Module
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales