Expand my Community achievements bar.

import com.adobe.fd.output.api.OutputService is not resolving in Java file (AEMaaCS Local SDK)

Avatar

Level 2

I've added the following Maven dependency to both the parent POM and the core POM. Now, I'm attempting to utilize this service within an AEM servlet by importing com.adobe.fd.output.api.OutputService. However, Eclipse is unable to resolve or import this package.

I'm on AEMaaCS Local SDK.

 

<dependency>

<groupId>com.adobe.aemfd</groupId>

<artifactId>aemfd-client-sdk</artifactId>

<version>6.3.0</version>

<scope>provided</scope>

</dependency>

25 Replies

Avatar

Employee Advisor

I don’t think you  use that package on cloud service AEM forms

To use output service in AEM forms cs, you will have to make a post call to rest api to generate documents 

Avatar

Level 2

@workflowuser This package is already part of below mentioned maven dependency and still its not resolving after including this. I've attached screenshot for reference.

<dependency>
    <artifactId>adobe-lc-forms-bedrock-connector</artifactId>
    <version>2.0.64</version>
    <groupId>com.adobe.aemfd</groupId>
    <scope>provided</scope>
</dependency>

 

MohanJo_0-1710451680700.png

 

Avatar

Employee Advisor

Can you please let us know what steps have you followed so far?

 

Avatar

Level 2

Hi @workflowuser - I have included following two dependencies in both the parent POM and the core POM. Now, I'm attempting to utilize this service within an AEM servlet by importing this package com.adobe.fd.output.api.OutputService. However, Eclipse is unable to resolve or import this package.

 

I got this first dependency from the screenshot i shared above.

<dependency>
    <artifactId>adobe-lc-forms-bedrock-connector</artifactId>
    <version>2.0.64</version>
    <groupId>com.adobe.aemfd</groupId>
    <scope>provided</scope>
</dependency>

 

<dependency>

<groupId>com.adobe.aemfd</groupId>

<artifactId>aemfd-client-sdk</artifactId>

<version>6.3.0</version>

<scope>provided</scope>

</dependency>

 

 

Avatar

Level 2

@workflowuser - It's a regular AEM Maven Archetype project. It was created a few months ago. Now, we have a requirement to generate PDF from XDP. There is a similar example on Adobe site. But my imports are not resolved.

https://experienceleague.adobe.com/en/docs/experience-manager-learn/forms/document-services/using-fr...

 

import com.adobe.fd.output.api.OutputService;

import com.adobe.fd.output.api.OutputServiceException;

import com.adobe.fd.output.api.PDFFormRenderOptions;

import com.adobe.fd.output.api.PDFOutputOptions;

import com.adobe.fd.output.api.RenderOptions;

import com.adobe.fd.output.api.RenderedResult;

 

 

 

Avatar

Employee Advisor

For AEM forms cloud service it’s a little different to create your project

please follow the documentation on creating AEM project for cloud service 

The way you generate documents on cloud service is different from AEM 6.5

Avatar

Level 2

@workflowuser - What I'm attempting to clarify is the availability of the OutputService APIs. If these APIs are already exposed, then why can't we utilize them directly? The dependency finder screenshot above indicates that the package is indeed available in AEM, along with the respective Maven dependency required for inclusion. I've followed this approach accordingly. Moreover, the example provided in the link above also employs the same methodology. Instead of invoking a cloud service, they leverage the OutputService APIs directly.

Avatar

Employee Advisor

the link you are following is for 6.5.It will not work for AEM Forms Cloud Service

Avatar

Level 2

@workflowuser where are you seeing that it's 6.5 link? Sorry, I'm not seeing it.

Avatar

Employee Advisor

If there is no cloud service in the url it’s not for cloud service

It’s for 6.5, I have sent you a link for cloud service document generation 

Avatar

Level 2

@workflowuser  We are on AEM Cloud with Forms. Presently, we rely on the communication APIs to generate PDFs from XDPs, which is working well. However, we encounter difficulties when the XDPs contain fragment XDPs. In such cases, the communication APIs fail to generate the PDFs.

After conducting research, we discovered that utilizing the OutputService APIs could potentially address our need to generate PDFs from XDPs that reference fragment XDPs. However, I'm uncertain why we're unable to leverage these existing APIs already exported in AEM.

Avatar

Employee Advisor

I need to confirm if fragments are supported on cloud service 

give me a day or two to get back to you on this

Avatar

Level 2

@workflowuser Both the main XDP and the fragment XDP are uploaded to AEM Forms. Presently, we store the main XDP in one folder, which references the fragment XDP located in a subfolder. For instance, the main XDP resides in /content/dam/main.xdp, while the fragment XDP is stored in /content/dam/fragments/x1.xdp.

 

Subsequently, we invoke the communication API /adobe/forms/doc/v1/generatePDFOutput to generate the PDF. While this process succeeds without issues when there are no fragment reference XDPs, it encounters failures as soon as fragments are present.

Avatar

Employee Advisor

Xdp fragments are supported and you will have to use the document generation api which are available for forms cloud service 

 

Avatar

Level 2

@workflowuserI couldn't locate an API that can read both the main XDP and fragment XDPs simultaneously. The example provided in the below link only demonstrates handling a single XDP. I'm seeking assistance to understand how the logic should traverse both the main XDP and fragment XDPs. Any pointers will be highly appreciated.

 

https://experienceleague.adobe.com/en/docs/experience-manager-learn/cloud-service/forms/doc-gen-form...

 

Avatar

Level 2

@workflowuser Could you please provide the exact api that we can use to read fragment xdps?

Avatar

Employee Advisor

Pass the template path as crx:///<the path> Or you can set the content root in options and give the template name in the template parameter. It will resolve the template along with fragments and generate the PDF.

This article should help

https://experienceleague.adobe.com/en/docs/experience-manager-learn/cloud-service/forms/doc-gen-form...