我正在使用epfhtmltopdf dll将HTML转换为pdf,其中页面正在渲染但是我们在页面上有一个图形,在获得DIV元素的ID之后由角度js调用但是没有反映在pdf中,因为页面得到渲染但图表在2秒后出现。我也使用了属性
pdfConverter.ConversionDelay = 20;
但是,它仍然需要时间但没有运气 请帮忙 这是给定的代码:library(labeling)
df <- data.frame("estimate" = c(9.81, 14.29, 12.94),
"lower" = c(4.54, 6.25, 5.12),
"upper" = c(12.85, 20.12, 15.84))
ticks <- extended(min(df$lower), max(df$upper), m = 5, only.loose = TRUE,
Q=c(2, 5, 10))
png("examplePlot.png", width = 1200, height = 900, pointsize = 10, res = 300)
bars <- barplot(df$estimate, horiz = TRUE, col = "white", border = NA,
xlim = c(min(ticks), max(ticks)), xaxt = "n", main = "Example")
arrows(df$lower, bars, df$upper, bars, code = 3, angle = 90, length = 0.03)
points(df$estimate, bars, pch = 20)
tickLabels <- paste(ticks, "%", sep = "")
axis(1, at=ticks, labels = tickLabels, cex.axis=1)
axis(2, at = bars, labels = c("c", "b", "a"), lwd = 0, las = 2)
dev.off()
谢谢,
仅限Ritesh
答案 0 :(得分:0)
来自常见问题解答:http://www.html-to-pdf.net/FAQ.aspx
PdfConverter具有以下属性,用于控制转换期间的JavaScript,Java Applet和ActiveX下载和执行:ScriptsEnabled,ScriptsEnabledInImage,ActiveXEnabled,ActiveXEnabledInImage。默认情况下,这些属性为false,这意味着转换期间未启用JavaScript代码。要激活JavaScript,只需在使用可选文本转换为PDF时设置PdfConverter.ScriptsEnabled = true
,或在转换为包含嵌入图像的PDF时设置PdfConverter.ScriptsEnabledInImage = true
。