Hey Atir,
It seems everytime I try to call ViewHtmlHandler,ViewImage handler, a new file is created in case if the file name is not specified as a parameter. Since we don't have the file in the local folder we are passing input stream to create the file.
Initially there were lot of files that were getting generated and after adding the filename as a parameter, there is a reduction in the number of folders that are getting created. I will add the zip file that contains the folders that are getting created. I am also not sure why a file is being created with _pdf in the filename. Shouldn't the filename be .pdf
com.merckgroup.aem.healthcare.doucment.groupdocs.servlets.ViewDocument fileName==>GeoPyramid_Datasheet.pdf
At this point, I am unable to go beyond the for loop which maybe the reason why the style tag is not getting generated for the html file. Refer the screenshot. I don't see the style tag in the code.
LOG.error("Log3==");
List test = page.getHtmlResources();
LOG.error("page.getHtmlResources()==>"+page.getHtmlResources());
for (HtmlResource resource : page.getHtmlResources()) {
LOG.error("resource.getResourceType()"+resource.getResourceType());
Refer the below code that I used to get the html pages which led to multiple folder creation. I have also added log output.
htmlPages = ViewerUtils.getViewerHtmlHandler().getPages(asset.getOriginal().getStream(),fileName,htmlOptions);
LOG.error("htmlPages==="+htmlPages);
LOG.error("htmlPages1==="+ViewerUtils.getViewerHtmlHandler().getPages(asset.getOriginal().getStream()));
LOG.error("htmlPages2==="+ViewerUtils.getViewerHtmlHandler().getPages(asset.getOriginal().getStream(),htmlOptions));
20.01.2017 10:40:43.461 *ERROR* [0:0:0:0:0:0:0:1 [1484926838165] POST /services/ViewDocument HTTP/1.1] com.merckgroup.aem.healthcare.doucment.groupdocs.servlets.ViewDocument doctype==GeoPyramid_Datasheet.pdf
20.01.2017 10:40:43.573 *ERROR* [0:0:0:0:0:0:0:1 [1484926838165] POST /services/ViewDocument HTTP/1.1] com.merckgroup.aem.healthcare.doucment.groupdocs.servlets.ViewDocument htmlPages===com.groupdocs.viewer.internal.c.a.ms.a.a.a.n@6f5e7798
20.01.2017 10:40:50.544 *ERROR* [0:0:0:0:0:0:0:1 [1484926838165] POST /services/ViewDocument HTTP/1.1] com.merckgroup.aem.healthcare.doucment.groupdocs.servlets.ViewDocument htmlPages1===com.groupdocs.viewer.internal.c.a.ms.a.a.a.n@3a911c67
20.01.2017 10:40:52.026 *ERROR* [0:0:0:0:0:0:0:1 [1484926838165] POST /services/ViewDocument HTTP/1.1] com.merckgroup.aem.healthcare.doucment.groupdocs.servlets.ViewDocument htmlPages2===com.groupdocs.viewer.internal.c.a.ms.a.a.a.n@10066e88
Storage and Temp folder defined in ViewerUtils:
public static final String STORAGE_PATH = "/tmp1";//getProjectBaseDir().resolve("src/main/webapp/storage").toString();
// public static final String TEMP_PATH = "/tmp";//System.getProperty("java.io.tmpdir");
public static final String TEMP_PATH = System.getProperty("java.io.tmpdir");
Regards
Chetan Mahendru