avatar
doGet Generate PDF Online AEM AEM

>+ Writing class named PDFIntegrationService.java

package com.flagtick.core.services;

public interface PDFIntegrationService {

    String functionGetDummy();
}

>+ Writing class named PDFIntegrationServiceImpl.java as below:

package com.flagtick.core.services.impl;

import com.flagtick.core.services.PDFIntegrationService;
import org.osgi.service.component.annotations.Component;

@Component(
        immediate = true,
        service = PDFIntegrationService.class
)
public class PDFIntegrationServiceImpl implements PDFIntegrationService {
    @Override
    public String functionGetDummy() {
        return "Hello World";
    }
}

>+ Insert couple of essential maven repositories for work with PDF. (core folder)

<dependency>
	<groupId>org.jsoup</groupId>
	<artifactId>jsoup</artifactId>
	<version>1.14.3</version>
</dependency>
<dependency>
	<groupId>org.xhtmlrenderer</groupId>
	<artifactId>core-renderer</artifactId>
	<version>R8</version>
</dependency>
<dependency>
	<groupId>commons-io</groupId>
	<artifactId>commons-io</artifactId>
	<version>2.11.0</version>
</dependency>
Notice that you can access JCR to check URL is valid. For example: http://localhost:4502/content/flagtick/us/en/test-001/jcr:content/root/container/contribution_verification.contribution-verification.json. 

Here is what will we need to check from our side.

From our observation, the URL is wrong and 404 will appear No Resource. You need to update contribution_verification into contribution-verification.

http://localhost:4502/content/flagtick/us/en/test-001/jcr:content/root/container/contribution-verification.contribution-verification.json

Now, let pass parameter into doGet request. Refer link here:

You need to login to do this manipulation!