如何将今天的日期添加到pdf。 [英] how to add todays date to pdf.?

查看:80
本文介绍了如何将今天的日期添加到pdf。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于导出到pdf文件的按钮..完美的工作问题是必须在pdf上显示当前日期怎么可能.????div class =h2_lin>解决方案

使用日期时间 [< a href =http://msdn.microsoft.com/en-us/library/system.datetime(v=vs.110).aspx\"target =_ blanktitle =New Window> ^ ]获取今天的日期并将其绘制到PDF。您使用的是什么PDF库? PDFSharp?


段落段落=新段落(新词组(DateTime.Now.ToString())); 
pdfDoc.Add(新段落(段落));


i am having a buton which is used to export to pdf file..its working perfectly the problem is have to display the currentdate on the pdf how is it possible.???

解决方案

Use DateTime[^] to get todays date and draw it to the PDF. What PDF library are you using? PDFSharp?


Paragraph paragraphs = new Paragraph(new Phrase(DateTime.Now.ToString()));
 pdfDoc.Add(new Paragraph(paragraphs));


这篇关于如何将今天的日期添加到pdf。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆