Html2PDFWebCapture.java
3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.aemfd.docmanager.Document
* com.adobe.pdfg.exception.ConversionException
* com.adobe.pdfg.exception.FileFormatNotSupportedException
* com.adobe.pdfg.exception.InvalidParameterException
* com.adobe.pdfg.logging.PDFGLogger
*/
package com.adobe.pdfg.impl;
import com.adobe.aemfd.docmanager.Document;
import com.adobe.pdfg.exception.ConversionException;
import com.adobe.pdfg.exception.FileFormatNotSupportedException;
import com.adobe.pdfg.exception.InvalidParameterException;
import com.adobe.pdfg.impl.GeneratePDFServiceImpl;
import com.adobe.pdfg.impl.GeneratePDFUtil;
import com.adobe.pdfg.impl.Html2PDFConvertorHelper;
import com.adobe.pdfg.logging.PDFGLogger;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Map;
public class Html2PDFWebCapture
implements Html2PDFConvertorHelper.IHtml2PDFConvertor {
protected PDFGLogger pdfgLogger = PDFGLogger.getPDFGLogger(Html2PDFConvertorHelper.class);
/*
* WARNING - Removed try catching itself - possible behaviour change.
* Enabled aggressive block sorting
* Enabled unnecessary exception pruning
* Enabled aggressive exception aggregation
*/
public Map createPDF(GeneratePDFServiceImpl coreSvcImpl, String inputUrl, String fileTypeSettingsName, String securitySettingsName, Document settingsDoc, Document xmpDoc, String configString, File pdfgTmpDir, int spideringLevel, boolean isURL) throws ConversionException, FileFormatNotSupportedException, InvalidParameterException, Exception {
String html = "<html><META HTTP-EQUIV=\"refresh\" content=\"2;url=" + inputUrl + "\"></html>";
File tempHtmlFile = new File(pdfgTmpDir, "WebCapture.html");
FileWriter fileWriter = null;
try {
try {
fileWriter = new FileWriter(tempHtmlFile);
fileWriter.write(html);
fileWriter.flush();
}
catch (IOException e) {
this.pdfgLogger.debug(e.getMessage());
this.pdfgLogger.trace(e.getMessage(), null, (Throwable)e);
Object var16_15 = null;
if (fileWriter == null) return GeneratePDFUtil.getNative2PDFCaller().createPDF(coreSvcImpl, new Document(tempHtmlFile, false), inputUrl, true, null, settingsDoc, configString, xmpDoc, false);
fileWriter.close();
return GeneratePDFUtil.getNative2PDFCaller().createPDF(coreSvcImpl, new Document(tempHtmlFile, false), inputUrl, true, null, settingsDoc, configString, xmpDoc, false);
}
Object var16_14 = null;
if (fileWriter == null) return GeneratePDFUtil.getNative2PDFCaller().createPDF(coreSvcImpl, new Document(tempHtmlFile, false), inputUrl, true, null, settingsDoc, configString, xmpDoc, false);
fileWriter.close();
return GeneratePDFUtil.getNative2PDFCaller().createPDF(coreSvcImpl, new Document(tempHtmlFile, false), inputUrl, true, null, settingsDoc, configString, xmpDoc, false);
}
catch (Throwable var15_18) {
Object var16_16 = null;
if (fileWriter == null) throw var15_18;
fileWriter.close();
throw var15_18;
}
}
}