PDF Handler | Community
Skip to main content
October 16, 2015
Solved

PDF Handler

  • October 16, 2015
  • 5 replies
  • 1039 views

Hi everyone,

The basic PDF Handler seems to create subassets for every single page, which can be quiet annoying, if PDF's are uploaded with more than 100 pages.

How do we change this behaviour to only create an image for the first page?


Kind regards,

 

Jerry

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

You can use the PdfHandler API and a custom handler:

https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/dam/handler/standard/pdf/PdfHandler.html

This class extends AbstractAssetHandler.

Bascially - you have to create your own handler and use PdfHandler to define the functionality that you want. That is the reason for the PdfHandler class. 

We have a community article that shows you how to create a custom handler that uses AbstractAssetHandler.

https://helpx.adobe.com/experience-manager/using/damhandler.html

5 replies

smacdonald2008
smacdonald2008Accepted solution
New Participant
October 16, 2015

You can use the PdfHandler API and a custom handler:

https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/dam/handler/standard/pdf/PdfHandler.html

This class extends AbstractAssetHandler.

Bascially - you have to create your own handler and use PdfHandler to define the functionality that you want. That is the reason for the PdfHandler class. 

We have a community article that shows you how to create a custom handler that uses AbstractAssetHandler.

https://helpx.adobe.com/experience-manager/using/damhandler.html

smacdonald2008
New Participant
October 16, 2015

What version of CQ are you using? 

October 16, 2015

Thanks for the informations.

 

As I understand, if we write a new Handler for PDF's, this will not overwrite the existing one. So we will have two handlers and have to manually deactivate the original one.

Is there a possibility to:

    1. Overwrite the existing one

or

    2. deactivate the existing one via a mecanism/package/bundle. Otherwise with each restart of the AEM process, it will started again and has to be deactivated manually. We have several author instances.

smacdonald2008
New Participant
October 16, 2015

I am not sure why you want to deactivate the existing one? When you upload a PDF - the handler will be invoked. Why would you want to deactivate it? 

October 16, 2015

As I said, we just want to overwrite the original one or deactivate it

The reason is, that we will have quite a lot of PDF's with a lot of pages. This will pollute the system with preview images of pages, which are never needed. Furthermore we want different sizes for the preview-images.

The goal is to have 1 preview Image of the first page in custom sizes. If you see a better way, than rewrite the PDF Handler, please let me know.

 

Kind regards,

 

Jerry