When we use PdfStamper to merge fields.
2008-10-17 17:04
525 查看
When we use PdfStamper to merge fields. we will find
"This file is damaged, Adobe acrobat can not repair the document
most adobe versions, give message “This file is damaged”, but it can repair.
Unfortunately some versions can not repair."
MemoryStream stream = new MemoryStream();
PdfReader reader = new PdfReader(path);
PdfStamper stamper = new PdfStamper(reader, stream);
AcroFields af = stamper.AcroFields;
af.SetField("CurrentDate", DateTime.Now.ToShortDateString());
I try to change memoryStream to filestream. no error again.
"This file is damaged, Adobe acrobat can not repair the document
most adobe versions, give message “This file is damaged”, but it can repair.
Unfortunately some versions can not repair."
MemoryStream stream = new MemoryStream();
PdfReader reader = new PdfReader(path);
PdfStamper stamper = new PdfStamper(reader, stream);
AcroFields af = stamper.AcroFields;
af.SetField("CurrentDate", DateTime.Now.ToShortDateString());
I try to change memoryStream to filestream. no error again.
相关文章推荐
- When do we need to use Inheritance?
- When to use DMU?
- Swift Optionals: When to use if let, when ? and !, when as? and as
- Java SE series:1. environment configure and Hello world! [We use compiler and packager to create an application!]
- Why and when to use AtomicIntegerFieldUpdater in java?
- When to use Delegation, Notification, or Observation in iOS
- When to Use Delegates Instead of Interfaces
- When to use LinkedList and When to use ArrayList- An answer in StackOverFlow
- How do we release the GDI object when we use selectobject choosing a brush?
- Use iterators and [] rather than at() when you want to optimize speed;
- When to use assert() and when to use try catch?
- 每日英语:When The Boss Works Long Hours, Do We All Have To?
- ABI detection failed.make sure to use a matching tool chain when building
- Programming Basic--why we need to add ' extern "C" ' in C++ program when calling the function which is complied by C complier?
- Knowing When to Use Override and New Keywords (C# Programming Guide)
- Failing To See the Big Picture - Mistakes we make when learning programming
- Why And When To Use Pre-Update and Pre-Insert Triggers In Oracle Forms
- 什么时候使用Decimal 类型(When to Use the Decimal Type)
- how to fix "Cannot find a valid baseurl for repo: poptop-stable/7" in centos 7 *64 when use "yum -y
- 干活来袭:Effective Concurrency: Know When to Use an Active Object Instead of a Mutex