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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?