我正在使用 Silverlight BING Map Api 在我的网站上显示位置(通过提供地址)。
我想以编程方式在 PDF 文件中显示这个 map 位置,我尝试了很多使用“wkhtmltopdf”但都是徒劳,它显示空白而不是 BING map ...
在这种情况下请指导我,我愿意使用任何其他开源 PDF 生成工具。
谢谢 极限主义者
最佳答案
如果您想将图像插入 PDF,请使用 iText library 。开始使用它非常容易:
string pdfFilename = @"c:\temp\test.pdf";
string imageFilename = @"C:\map.jpg";
// Create PDF writer, document and image to put
iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(imageFilename);
Document doc = new Document();
PdfWriter pdfW = PdfWriter.GetInstance(doc, new FileStream(pdfFilename, FileMode.Create));
// Open created PDF and insert image to it
doc.Open();
doc.Add(image);
doc.Close();
或者您想将 Bing map 保存为图像吗?
关于c# - 以编程方式打印 PDF 中的 BING map 位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9793290/