douguxun6866 2015-02-11 10:26
浏览 36

文档网址不适用于谷歌云打印

I am trying to print the document from my local folder by using google cloud print, but it reports the error Could not fetch the URL. this folder is on my htdocs folder & document file & code file is on the same folder. But am unable to find whats wrong.

here is my print dialog js code :

<script src="https://www.google.com/cloudprint/client/cpgadget.js">
</script>
<script>
 window.onload = function() {
 var gadget = new cloudprint.Gadget();
gadget.setPrintButton(cloudprint.Gadget.createDefaultPrintButton("print_button_container")); // div id to contain the button
gadget.setPrintDocument("url", "Test Page", "");
gadget.setPrintDocument("application/pdf", "PDF Doc" );
gadget.setPrintDocument("url", "Test Page",  "http://localhost/pos/test.pdf");
var btn = document.getElementById("custom_print_button");
gadget.setPrintButton(btn);
gadget.openPrintDialog();
}
</script>

I have tried both the form of url i.e http://localhost/pos/test.pdf or test.pdf but unable to fetch the doc. please any one have idea how to pass the doc url to be print.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 sub地址DHCP问题
    • ¥15 delta降尺度计算的一些细节,有偿
    • ¥15 Arduino红外遥控代码有问题
    • ¥15 数值计算离散正交多项式
    • ¥30 数值计算均差系数编程
    • ¥15 redis-full-check比较 两个集群的数据出错
    • ¥15 Matlab编程问题
    • ¥15 训练的多模态特征融合模型准确度很低怎么办
    • ¥15 kylin启动报错log4j类冲突
    • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大