pdfa

How can I test if a PDF document is PDF/A compliant using iTextSharp?

扶醉桌前 提交于 2019-12-02 10:04:21
I have a existing PDF file and with iTextSharp I want to test if it is PDF/A compliant. I don't want convert or create a file, just read and check if it is a PDF/A. I have not tried anything because I did not find any methods or properties of the class PdfReader of iTextSharp, saying that the PDF is PDF/A. For now it would be enough to know how to verify that the document claims to be PDF/A compatible Thanks Antonio After a long search i tried this way and seems to work: Dim reader As iTextSharp.text.pdf.PdfReader = New iTextSharp.text.pdf.PdfReader(sFilePdf) Dim yMetadata As Byte() = reader

PDF/A signed with iText7 allows changing attached documents without breaking a signature

孤人 提交于 2019-12-02 07:11:21
问题 I have created a PDF/A document using iText7. The created document has an attachment (). The attachment is a .csv file. Then the whole PDF/A has been signed. I have opened the attached .csv file and changed it after I have signed it. I have used following code to verify the signature: public PdfPKCS7 verifySignature(SignatureUtil util, String name) throws GeneralSecurityException, IOException { System.out.println("Signature covers whole document: " + util.signatureCoversWholeDocument(name));

Creating PDF/A with GhostscriptProcessor

南笙酒味 提交于 2019-12-02 06:48:55
问题 I want to convert a PDF file into PDF/A with GhostscriptProcessor, but the result is a PDF not PDF/A. GhostscriptProcessor gsproc = new GhostscriptProcessor(Properties.Resources.gsdll32); gsproc.StartProcessing(CreatePDFA(@"C:\test\PDF.pdf", @"C:\test\PDFA.pdf"), new GsStdio()); And the method: CreateTestArgs(string inputPath, string outputPath) { List<string> gsArgs = new List<string>(); gsArgs.Add("-dPDFA"); gsArgs.Add("-dBATCH"); gsArgs.Add("-dNOPAUSEgsArgs"); gsArgs.Add("-sDEVICE=pdfwrite

PDF/A signed with iText7 allows changing attached documents without breaking a signature

大城市里の小女人 提交于 2019-12-02 04:06:33
I have created a PDF/A document using iText7. The created document has an attachment (). The attachment is a .csv file. Then the whole PDF/A has been signed. I have opened the attached .csv file and changed it after I have signed it. I have used following code to verify the signature: public PdfPKCS7 verifySignature(SignatureUtil util, String name) throws GeneralSecurityException, IOException { System.out.println("Signature covers whole document: " + util.signatureCoversWholeDocument(name)); System.out.println("Document revision: " + util.getRevision(name) + " of " + util.getTotalRevisions());

Creating PDF/A with GhostscriptProcessor

十年热恋 提交于 2019-12-02 02:02:50
I want to convert a PDF file into PDF/A with GhostscriptProcessor, but the result is a PDF not PDF/A. GhostscriptProcessor gsproc = new GhostscriptProcessor(Properties.Resources.gsdll32); gsproc.StartProcessing(CreatePDFA(@"C:\test\PDF.pdf", @"C:\test\PDFA.pdf"), new GsStdio()); And the method: CreateTestArgs(string inputPath, string outputPath) { List<string> gsArgs = new List<string>(); gsArgs.Add("-dPDFA"); gsArgs.Add("-dBATCH"); gsArgs.Add("-dNOPAUSEgsArgs"); gsArgs.Add("-sDEVICE=pdfwrite"); gsArgs.Add(@"-sOutputFile=" + outputPath); gsArgs.Add(@"-f" + inputPath); return gsArgs.ToArray();

Convert PDF to PDF/A3 or PDF/A-1 to PDF/A-3

爷,独闯天下 提交于 2019-12-01 11:28:21
I'm testing iTextSharp to generate ZUGFeRD-Files. My first step was to generate a ZUGFeRD conform file from an existing PDF/A-3 file. This was successfull by using PDFACopy and creating the necessary PDFFileSpecification. The next step would be to generate a PDF/A-3 file from an existing PDF or PDF/A-1 file and this is the hard part. First, when I'm trying to use PDFACopy in combination with a regular PDF (not PDF/A) im getting an error that PDFACopy can only be used with PDF/A-conform files. My first question is, how to get an PDF/A-3-conform file from a PDF with iTextSharp? To reduce the gap

FO to PDF/a Conversion with Apache FOP Java Library

℡╲_俬逩灬. 提交于 2019-11-29 17:30:15
I'm trying to convert .fo files to PDF/a with Apache FOP 2.1 with the exemple code given in the documentation. I managed to convert the helloworld.fo file into PDF but, when I tried to convert it into PDF/a file I get this error: org.apache.fop.pdf.PDFConformanceException: For PDF/A-1a, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Helvetica That's why I tried to embedded fonts in the fop.xconf file: <fonts> <font kerning="yes" embed-url="C:/Users/thinkpad/workspace/FopConverter/Fonts/arial.ttf" name="Arial"> <font-triplet name="Arial" style="normal" weight="700"/> <

iText page number in header within PDF/A

泪湿孤枕 提交于 2019-11-29 15:51:42
I have trying to adjust the code to add page number in PDF to PDF/A. I have added the font, color scheme and the PDF/A creation works if I leave out adding the addition of the PdfTemplate . // PDF is created successfully when this part is removed // Though without the page number in the header PdfPCell cell = new PdfPCell(Image.getInstance(total)); cell.setBorder(Rectangle.BOTTOM); table.addCell(cell);" Though I would really like the header with page number to be in it too. I am out of clues how to add the font to the PdfPCell . With other fields I usually add a phrase or a paragraph to which

FO to PDF/a Conversion with Apache FOP Java Library

妖精的绣舞 提交于 2019-11-28 10:23:38
问题 I'm trying to convert .fo files to PDF/a with Apache FOP 2.1 with the exemple code given in the documentation. I managed to convert the helloworld.fo file into PDF but, when I tried to convert it into PDF/a file I get this error: org.apache.fop.pdf.PDFConformanceException: For PDF/A-1a, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Helvetica That's why I tried to embedded fonts in the fop.xconf file: <fonts> <font kerning="yes" embed-url="C:/Users/thinkpad/workspace

iText page number in header within PDF/A

爷,独闯天下 提交于 2019-11-28 09:48:31
问题 I have trying to adjust the code to add page number in PDF to PDF/A. I have added the font, color scheme and the PDF/A creation works if I leave out adding the addition of the PdfTemplate . // PDF is created successfully when this part is removed // Though without the page number in the header PdfPCell cell = new PdfPCell(Image.getInstance(total)); cell.setBorder(Rectangle.BOTTOM); table.addCell(cell);" Though I would really like the header with page number to be in it too. I am out of clues