Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

New Root appears for data when rendering form

Avatar

Avatar
Validate 10
Level 5
tarekahf
Level 5

Likes

32 likes

Total Posts

409 posts

Correct Reply

10 solutions
Top badges earned
Validate 10
Validate 1
Give Back 50
Give Back 5
Give Back 3
View profile

Avatar
Validate 10
Level 5
tarekahf
Level 5

Likes

32 likes

Total Posts

409 posts

Correct Reply

10 solutions
Top badges earned
Validate 10
Validate 1
Give Back 50
Give Back 5
Give Back 3
View profile
tarekahf
Level 5

27-04-2016

We are using the sample code below to render the form.

Just recently, we noticed that when the form is rendered and the XML is exported using Adobe Acrobat, we see a new root showing on top of the previous root node. For example, of the data structure looks as follows:

<root>

  <customer_name>John</customer_name>

</root>

it will become like the following:

<xfa:data>

  <root>

    <customer_name>John</customer_name>

  </root>

</xfa:data>

Sample code used:

    PDFFormRenderSpec pdfFormRenderSpec = new PDFFormRenderSpec(

    true, //boolean cacheEnabled

    null,//PDFVersion

    true,//boolean taggedPDF

    false,//boolean linearizedPDF

    null,//String seedPDF

    AcrobatVersion.Acrobat_9,

    null,//String xCIURI

    sCharSet,//String charset

    RenderAtClient.Yes,//key to dynamic forms!

    sLocale,// locale

    false, //standAlone

    FormModel.both,

    false//setXML

    );       

                   

            //Specify URI values that are required to render a form

            URLSpec uriValues = new URLSpec();

            uriValues.setContentRootURI("repository:///");

                   

            //Invoke the renderPDFForm method and write the

            //results to a client web browser

            FormsResult formOut = formsClient.renderPDFForm(

                        formName,               //formQuery

                        oInputData,             //inDataDoc

                        pdfFormRenderSpec,      //PDFFormRenderSpec

                        uriValues,                //urlSpec

                        null            //attachments

                        );

       

            //Create a Document object that stores form data

            myData = formOut.getOutputContent();

            myData.passivate();

            myData = readerExtensionsApply(sRECert, myFactory, myData);

Appreciate your help to resolve this problem.

Tarek

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar
Validate 10
Level 5
tarekahf
Level 5

Likes

32 likes

Total Posts

409 posts

Correct Reply

10 solutions
Top badges earned
Validate 10
Validate 1
Give Back 50
Give Back 5
Give Back 3
View profile

Avatar
Validate 10
Level 5
tarekahf
Level 5

Likes

32 likes

Total Posts

409 posts

Correct Reply

10 solutions
Top badges earned
Validate 10
Validate 1
Give Back 50
Give Back 5
Give Back 3
View profile
tarekahf
Level 5

03-05-2016

Actually that was very unusual. The extra root node "xfa:data" showed up only after the pdf was rendered from the server. Before that everything was normal.

Tarek

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

03-05-2016

As far as i know Acrobats import/export methods only handle the data stored in the default data node xfa:data under xfa:datasets.

To get a different export result you can use a XSLT-stylesheet, which can be embedded through the forms data connection settings.