• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

conditional-section does not work in header

Community Beginner ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

I am currently trying out the Document Generator service as part of a POC for a current project and ran into what I believe is a bug.  The conditional-section syntax is not being parsed if it is part of a Word header section.  If I place it in the body of the document it works, but if I move it up into the header it just outputs the syntax rather than evaluating it.  Other tags are evaluated, just not the conditional-section tag.

Views

862

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 14, 2021 Jul 14, 2021

Copy link to clipboard

Copied

/*
 * Copyright 2021 Adobe
 * All Rights Reserved.
 *
 * NOTICE: Adobe permits you to use, modify, and distribute this file in
 * accordance with the terms of the Adobe license agreement accompanying
 * it. If you have received this file from a source other than Adobe,
 * then your use, modification, or distribution of it requires the prior
 * written permission of Adobe.
 */

const PDFServicesSdk = require('@adobe/pdfservices-node-sdk'),
    fs = require('fs');

/**
 * This sample illustrates how to merge the Word based document template with the input JSON data to generate
 * the output document in the PDF format.
 * <p>
 * To know more about document generation and document templates, please see the <a href="http://www.adobe.com/go/dcdocgen_overview_doc">documentation</a>
 * <p>
 * Refer to README.md for instructions on how to run the samples.
 */
try {
    // Initial setup, create credentials instance.
    const credentials =  PDFServicesSdk.Credentials
        .serviceAccountCredentialsBuilder()
        .fromFile("pdfservices-api-credentials.json")
        .build();

    // Setup input data for the document merge process
    const jsonString = fs.readFileSync('resources/salesOrder.json'),
        jsonDataForMerge = JSON.parse(jsonString);

    // Create an ExecutionContext using credentials
    const executionContext = PDFServicesSdk.ExecutionContext.create(credentials);

    // Create a new DocumentMerge options instance
    const documentMerge = PDFServicesSdk.DocumentMerge,
        documentMergeOptions = documentMerge.options,
        options = new documentMergeOptions.DocumentMergeOptions(jsonDataForMerge, documentMergeOptions.OutputFormat.PDF);

    // Create a new operation instance using the options instance
    const documentMergeOperation = documentMerge.Operation.createNew(options)

    // Set operation input document template from a source file.
    const input = PDFServicesSdk.FileRef.createFromLocalFile('resources/conditionalBugDemoTemplate.docx');
    documentMergeOperation.setInput(input);

    // Execute the operation and Save the result to the specified location.
    documentMergeOperation.execute(executionContext)
        .then(result => result.saveAsFile('output/conditionalBugDemoOutput.pdf'))
        .catch(err => {
            if(err instanceof PDFServicesSdk.Error.ServiceApiError
                || err instanceof PDFServicesSdk.Error.ServiceUsageError) {
                console.log('Exception encountered while executing operation', err);
            } else {
                console.log('Exception encountered while executing operation', err);
            }
        });
} catch (err) {
    console.log('Exception encountered while executing operation', err);
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 15, 2021 Jul 15, 2021

Copy link to clipboard

Copied

Thank you for confirming.  Please let me know when you have an ETA on the fix.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 15, 2021 Jul 15, 2021

Copy link to clipboard

Copied

Update:  I just heard back from the internal team.  It looks like it's technically not a bug.  We currently don't support conditionals in headers or footers, but are working to get the feature added to our backlog.  We will definitely keep you informed. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 15, 2021 Jul 15, 2021

Copy link to clipboard

Copied

Ok - it's definitely a deal breaker for us, so if there is anyway to get an ETA on a fix anytime soon, I would appreciate it.  Otherwise we will likely have to choose a different technology.  I would think it would be an issue for lots of customers given the use case I mentioned on the phone.  Usually mail merges have a customer address in a header section, and some of that information (e.g. multiple address lines) is nullable.  We will actually have the same issue with many of our footers, which often display addresses from different companies that can have a varying numbers of address lines.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 15, 2021 Jul 15, 2021

Copy link to clipboard

Copied

I dedinitely understand.  We are evaluating internally now and I will reply as soon we know something.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 20, 2021 Jul 20, 2021

Copy link to clipboard

Copied

Any update on this?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 21, 2021 Jul 21, 2021

Copy link to clipboard

Copied

Apologies for the delay.  I just spoke with the engineering team and we are still investigating.  I promise to get back with you as soon as I know anything.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 16, 2021 Sep 16, 2021

Copy link to clipboard

Copied

Kenneth - has the team started working on this fix yet?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 16, 2021 Sep 16, 2021

Copy link to clipboard

Copied

LATEST

Appologies, that was supposed to have been communicated to you by email.  The last information I was given is that they are working on it and it should be in a release during Q4. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources