DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Trending

  • Designing for Sustainability: The Rise of Green Software
  • Introducing Graph Concepts in Java With Eclipse JNoSQL
  • Next-Gen IoT Performance Depends on Advanced Power Management ICs
  • Building Resilient Networks: Limiting the Risk and Scope of Cyber Attacks

Creating Your Own Schema With the Adobe Document Generation Word Add-in

Learn about Adobe Document Generation API updates to make it simpler to use.

By 
Raymond Camden user avatar
Raymond Camden
·
Updated Apr. 11, 22 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
4.6K Views

Join the DZone community and get the full member experience.

Join For Free

When Document Generation API launched a few months ago, we included a Microsoft Word add-in to make it simpler for folks to design their Word templates for use within the API. To use the add-in, you needed to provide data in JSON format, either pasted in or uploaded via an existing file:

This worked perfectly fine if you had your data ready to go, but that wouldn’t always be possible, especially if you’re starting a new project and need to start prototyping quickly. Luckily, our latest update adds a few features to simplify this. Let’s take a quick look at what’s changed. Note — for folks who’ve already installed the Word add-in, it should update automatically for you. Suppose you haven’t installed this add-in yet; head over to our documentation for instructions on how to do it. 

Creating Your Own Data

The first change you’ll notice is right beneath the interface shown above, a new button that lets you continue without pasting or uploading:

If you select this, you’ll get a new button in the traditional tag editing user interface named “Create Tag”:

Selecting this will open a new dialog that prompts you for the type of data you want to create. You’ll be asked to provide a name, a category, and a type:

Let’s consider the types first. For the most part, this should be self-explanatory, but some things should be clarified. As developers, we’re used to seeing “string” to define text, but non-technical users may want to keep in mind that it’s just a fancy way of saying simple text. If your data represents a person’s name, you will select this.

“Number” would be used for numerical information. Keep in mind this includes numbers with decimals and negative numbers.

“Boolean” is a way of saying something either true or false. An example here could be a tag that represents if someone is in management or not.

Finally, “Object” would be how you would create nested data. An excellent example of this will be addressed. An address consists of multiple parts all grouped together. When you select this type, you’ll get an additional place to enter values beneath it.

After you’ve created a few tags, you can then use them as if you had uploaded or pasted in data manually.

Going back to the Create Tag dialog, the category drop-down is what you would use when building more advanced types of values. So, for example, selecting Image will create a tag that when inserted, will be an image. The add-in creates a very simple default image. Here’s how you create it:

And here’s how it will look in your Word template:

Notice I’m in the “Advanced” tab of the interface here. That’s where image tags will show up.

The category drop-down is also where you can create tables and lists. For tables, you’ll be prompted to enter columns and types:

There’s a similar experience for building out lists.

Testing Your Data

Once you’ve set up your tags, you can start designing your template and inserting the tags as normal. Here’s an example where I used all of my creativity (I’m quite proud of it):

Now it’s time to introduce another, incredibly cool feature in the latest update. Did you notice the “Generate document” button in the last screenshot? If not, here’s a close up:

If you have an account with us already and have credentials for the API, you can now generate your document directly RIGHT THEREFROM WORD! Sorry for all caps. I write code every day. I love writing code. But this one little button here is so darn useful I’m absolutely fine with it letting me skip code. It’s just for testing, but it makes iterating on your designs that much quicker. After you’ve provided your credentials, when you hit the button, you’ll see your tags now rendered in JSON, letting you change things if you want:

After hitting continue, the add-in will take the data and your Word document and do its magic:

If you hit the view button, you’ll be sent to an online version of the generated PDF:


What’s cool is that you can go back to Word, keep working, and then preview again and again until you get it right. As I said, the data is editable, so you can also do things like changing the value of Booleans to see how conditional blocks output in different cases. It’s all quick and easy and just a huge improvement to the process as a whole.

Next Steps

If you still haven’t had a chance yet to play with Document Generation, there’s no time like the present. We also recently launched an interactive web-based demo of the feature as yet another way to make it easy to learn how the API works.

Published at DZone with permission of Raymond Camden, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!