Open ZCHWorld opened 5 years ago
@ZCHWorld,
Thank you for contacting support.
Would you please share source and generated files as ZIP via Google Drive, Dropbox etc. along with narrowed down code snippet so that we may try to reproduce and investigate it in our environment.
PS: I work with Aspose as Developer Evangelist.
look here github demo. I'm looking forward to your reply. Thank you!
Thank you for sharing requested data.
We are afraid that the API does not support setting Title of generated HTML file. However, we have logged a feature request with ID PDFJAVA-38661 in our issue management system for further investigations. We will let you know as soon as some significant updates will be available in this regard.
@ZCHWorld
We have investigated the earlier logged ticket and found that the subsequent work with HTML after the conversion is not a target of PDF library. For this purpose some HTML library could be used. For example it could be done with Aspose.HTML library via code:
com.aspose.html.HTMLDocument htmlDoc = new com.aspose.html.HTMLDocument("fileName.html");
htmlDoc.setTitle("This is a Title");
htmlDoc.save("Output.html");
Or you could just edit the output HTML as a string by using Apache Commons library:
FileUtils.writeStringToFile(new File("fileName.html"), FileUtils.readFileToString(new File("Output.html"), "UTF-8").replace("<title>", "<title>This is a Title"), "UTF-8");
convert pdf to html but no title,how can i insert?