Expand my Community achievements bar.

SOLVED

How to change CQ5.6.1 dam path to local file path like c:\\\\x\\y\\z to dam path -

Avatar

Level 3

Hello, 

          My requirement is to convert pdf to jpg format i have used  PDFBOX api   i have used file input stream and .am able to convert pdf to image by giving static path but if i tried with dynamically providing the dam pdf file path to this api; it is showing me error in this line.

PDDocument doc=PDDocument.load(new FileInputStream(s));

Where s is the path of the file in DAM . I am getting exception like :-The system cannot find the path specified

 

The possible error I can think of is that fileinputstream takes the local file path 

 

Can anybody provide me a solution so as to how can we use the dam file path in inputfilestream I also used DAMUtil to get the assetbinary pat; but got the same error.

 

Or any other way to convert the pdf file to image in cq5?

Please provide solutions . I would be highly obliged.

 

Thanks,

1 Accepted Solution

Avatar

Correct answer by
Level 6

You can try this:

InputStream in = node.getNode("jcr:content").getProperty("jcr:data").getStream();

View solution in original post

3 Replies

Avatar

Correct answer by
Level 6

You can try this:

InputStream in = node.getNode("jcr:content").getProperty("jcr:data").getStream();

Avatar

Level 3

Thanks sam

I got solution with your reply.

Avatar

Level 6

Thanks Rahul, Please mark it as resolve