pdfstamper

Adjust width for image in Itextsharp while adding digital signature in GRAPHIC_AND_DESCRIPTION mode C# .net

試著忘記壹切 提交于 2020-05-17 06:27:08
问题 I want to adjust width of added Image along with description while signing pdf using itextsharp library C#. My code below regarding setting image and descreption in signature: var pdfStamper = PdfStamper.CreateSignature(reader, os, '\0', null, true); var signatureAppearance = pdfStamper.SignatureAppearance; var imageData = Path.Combine(_env.WebRootPath, ImagePathere); var image = Image.GetInstance(imageData); signatureAppearance.SignatureGraphic = image; BaseFont bf = BaseFont.CreateFont

How to insert a PdfPTable into an existing PDF template?

心不动则不痛 提交于 2020-01-24 10:35:08
问题 Update: After some discussion, we decided to go with TeX, specifically the windows compatible MiKTeX. We realised that even if we could get the dynamic lengthed table formatted by micromanaging the layout (which doesn't seem possible or is as tedious as calculating row height for each row), there are other dynamic controls like large text boxes that we would also need to micromanage so we decided to generate the whole doc on the fly. With that in mind, going to TeX was the obvious choice

Add named destinations to an existing PDF document with iText

无人久伴 提交于 2020-01-16 11:26:30
问题 I have a PDF previously created with FOP, and I need to add some named destinations to it so later another program can open and navigate the document with the Adobe PDF open parameters, namely the #namedest=destination_name parameter. I don't need to add bookmarks or other dynamic content but just some destinations with a name and thus injecting a /Dests collection with names defined in the resulting PDF. I use iText 5.3.0 and I read the chapter 7 of iText in Action (2nd edition), but still I

Add named destinations to an existing PDF document with iText

青春壹個敷衍的年華 提交于 2020-01-16 11:26:24
问题 I have a PDF previously created with FOP, and I need to add some named destinations to it so later another program can open and navigate the document with the Adobe PDF open parameters, namely the #namedest=destination_name parameter. I don't need to add bookmarks or other dynamic content but just some destinations with a name and thus injecting a /Dests collection with names defined in the resulting PDF. I use iText 5.3.0 and I read the chapter 7 of iText in Action (2nd edition), but still I

How to convert pdfstamper to byte array

纵饮孤独 提交于 2020-01-11 14:14:27
问题 In my application, i need to read the existing pdf and add barcode to the existing PDF and pass it to output stream. here the existing pdf is like template. I am using iText jar for adding barcode. I want to know the possibilities of converting PdfStamper object to byte array or PdfContentByte to byte array. Can anyone help on this? 回答1: Your question is unclear. I assume that you want to write to a ByteArrayOutputStream instead of to a FileOutputStream . There are different examples on how

PdfContentStreamEditor rotating image on PDF file

余生颓废 提交于 2020-01-06 06:35:20
问题 I have what I hope is an easy question. I'm trying to use iTextSharp to modify some PDF files, however it seems that the XMP metadata that iTextSharp puts at the end of the files is ruining the layout of the PDF files (and I'm not very conversant in the PDF format to understand at all why). You can see from the two images above that the document appears to have been rotated. From looking at the PDF files as binary differences however, the only thing different appears to be some XMP metadata

itextsharp setting the stamper FormFlatttening=true results in no output

杀马特。学长 韩版系。学妹 提交于 2019-12-24 21:40:00
问题 Using itextsharp v5.5.5.0 in VS2010 Setting the stamper FormFlattening = true no filed data is written to the output pdf. If set false the data is all present & correct but still editable (which I don't want) PdfReader pdfTemplate = new PdfReader("..\\..\\pdf\\BFC-Template.pdf"); FileStream fileOutputStream = new FileStream("..\\..\\pdf\\BFC.pdf", FileMode.Create); PdfStamper stamper = new PdfStamper(pdfTemplate, fileOutputStream); stamper.AcroFields.SetField("FitID", "1234"); stamper

Trying to use PdfStamper and MemoryStream to add data to existing PDF then email it

﹥>﹥吖頭↗ 提交于 2019-12-12 03:38:40
问题 Here is my chunk of code. It compiles fine and when I fire off the event I get the email, but I then get this error Email attachment ERROR on Adobe while opening(Acrobat could not open 'Att00002.pdf' because it is either not a supported file type or because the file has been damaged(for example, it was sent as an email attachment and wasnt correctly decoded.) string agentName = "My Name"; MemoryStream _output = new MemoryStream(); PdfReader reader = new PdfReader("/pdf/Agent/Specialist

itext setRotateContent Flag usage not clear

十年热恋 提交于 2019-12-12 02:25:07
问题 I am using pdfstamper to add the watermark to an existing pdf. When i keep the flag setRotateContent(true) , the watermark comes at the right position but when i keep it false, watermark is misplaced. I cant share the code due to some restrictions. I am sharing the cases. ORIGINAL PDF With setRotateContent(false) With setRotateContent(true) So my question is how exactly does the setRotateContent() works. I have tried the Api page as well. But all the examples are with setRotateContent(false)

Add multiple attachments in a pdf using itext pdf stamper

ぃ、小莉子 提交于 2019-12-12 02:04:32
问题 I want to add multiple attachments to a pdf file. When I go into the loop it only attaches the last attachment. sample code PdfReader reader = new PdfReader(FILE); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(realPath+"/Temp/"+sosValues.getCmaId()+".pdf")); for(SOSCustomerOrderFile cmaOrder:orderList) { PdfFileSpecification fs = PdfFileSpecification.fileEmbedded(stamper.getWriter(), null, cmaOrder.getFileName(), cmaOrder.getFileData()); /* stamper.getWriter(), null, "test