I need to convert the content page in a pdf format and save the pdf in dam.
I am able to create pdf file in dam from the below url with a string data but unable to read data from the content page.
Adobe Experience Manager Help | Creating a custom Adobe Experience Manager PDF service
Can anyone suggest me how can i proceed. I am using AEM-6.4
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
You can read complete HTML from inputStream and convert into string then create PDF.
Still CSS images are not gonna work with this.
like below:
URL url = new URL("https://www.example.com/");
URLConnection conn = url.openConnection();
// open the stream and put it into BufferedReader
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
StringBuilder out = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
out.append(line);
}
reader.close();
boolean success = HtmlToPdf.create()
.object(HtmlToPdfObject.forHtml(out.toString()))
.convert(pdfFilePath);
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi Arun,
We have used "https://github.com/wooio/htmltopdf-java". but its giving exception , we have tried with itext also but its not reading the images , can you please tell me how can i read the image because my html file contains images also.
Views
Replies
Total Likes
Hi,
You can read complete HTML from inputStream and convert into string then create PDF.
Still CSS images are not gonna work with this.
like below:
URL url = new URL("https://www.example.com/");
URLConnection conn = url.openConnection();
// open the stream and put it into BufferedReader
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
StringBuilder out = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
out.append(line);
}
reader.close();
boolean success = HtmlToPdf.create()
.object(HtmlToPdfObject.forHtml(out.toString()))
.convert(pdfFilePath);
Views
Replies
Total Likes