Re: [iText-questions] Problem with iTextSharp
Hi, What version are you using? I remember encountering this issue (or a similar one) last month and we fixed it for the recentmost release (5.5.0). Kind regards, Michaël. Crosby, Jonathan schreef op 18/02/2014 16:53: Hi there We have discovered an error with your code. When setting MoreInfo using the Stamper, there are some strange behaviours in combination with using some special characters. When the text being set contains a semicolon or a double quote, the keywords text is duplicated. Here is a vb.net example: Dimpdf_Reader AsNewPdfReader(str_FilePathOriginal) Dimpdf_Stamper AsNewPdfStamper(pdf_Reader, NewFileStream(str_FilePathNew, FileMode.Create)) Dimpdf_Dictionary AsNewDictionary(OfString, String) pdf_Dictionary = pdf_Reader.Info pdf_Dictionary.Remove(str_MetaFieldWrite) pdf_Dictionary.Add(str_MetaFieldWrite, Andy;) pdf_Stamper.MoreInfo = pdf_Dictionary pdf_Stamper.Close() Result in the Metadata: replacing the content of the field to pdf_Dictionary.Add(str_MetaFieldWrite, Andy) result in the correct behaviour: There may be further special characters causing this error. Please can you resolve this problem or at least inform us, if this is the expected behaviour of your tool and how we can avoid these duplicate values. Many thanks for this great tool kind regards Jonathan Crosby _ Jonathan Crosby Business Technology Swiss Global Asset Management Ltd. Hardstrasse 201, P.O. Box, CH-8037 Zurich T +41 58 426 61 32 www.swissglobal-am.com http://www.swissglobal-am.com/ Swiss Global cares about the environment: Please do not print this e-mail unless you really need to. This email is confidential. If you are not the intended recipient, please advise us immediately and delete this message. See https://www.swissglobal-am.com/Disclaimer_Email for further information on confidentiality, the risks of non-secure electronic communication, and certain disclosures which we are required to make in accordance with applicable legislation and regulations. If you cannot access this link, please notify us by reply message and we will send the contents to you. -- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php -- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] Problem with iTextSharp
This is because the ';'is a predefined special character for XMP metadata as defined in ISO 16682-1. There are no issues with iText. Leonard From: Crosby, Jonathan jonathan.cro...@swissglobal-am.commailto:jonathan.cro...@swissglobal-am.com Reply-To: Post here itext-questions@lists.sourceforge.netmailto:itext-questions@lists.sourceforge.net Date: Tuesday, February 18, 2014 10:53 AM To: Post here itext-questions@lists.sourceforge.netmailto:itext-questions@lists.sourceforge.net Subject: [iText-questions] Problem with iTextSharp Hi there We have discovered an error with your code. When setting MoreInfo using the Stamper, there are some strange behaviours in combination with using some special characters. When the text being set contains a semicolon or a double quote, the keywords text is duplicated. Here is a vb.net example: Dim pdf_Reader AsNewPdfReader(str_FilePathOriginal) Dim pdf_Stamper AsNewPdfStamper(pdf_Reader, NewFileStream(str_FilePathNew, FileMode.Create)) Dim pdf_Dictionary AsNewDictionary(OfString, String) pdf_Dictionary = pdf_Reader.Info pdf_Dictionary.Remove(str_MetaFieldWrite) pdf_Dictionary.Add(str_MetaFieldWrite, Andy;) pdf_Stamper.MoreInfo = pdf_Dictionary pdf_Stamper.Close() Result in the Metadata: [cid:image001.png@01CF2CC9.F03E3110] replacing the content of the field to pdf_Dictionary.Add(str_MetaFieldWrite, Andy) result in the correct behaviour: [cid:image002.png@01CF2CC9.F03E3110] There may be further special characters causing this error. Please can you resolve this problem or at least inform us, if this is the expected behaviour of your tool and how we can avoid these duplicate values. Many thanks for this great tool kind regards Jonathan Crosby _ Jonathan Crosby Business Technology Swiss Global Asset Management Ltd. Hardstrasse 201, P.O. Box, CH-8037 Zurich T +41 58 426 61 32 www.swissglobal-am.comhttp://www.swissglobal-am.com/ Swiss Global cares about the environment: Please do not print this e-mail unless you really need to. This email is confidential. If you are not the intended recipient, please advise us immediately and delete this message. See https://www.swissglobal-am.com/Disclaimer_Email for further information on confidentiality, the risks of non-secure electronic communication, and certain disclosures which we are required to make in accordance with applicable legislation and regulations. If you cannot access this link, please notify us by reply message and we will send the contents to you. attachment: image001.pngattachment: image002.png-- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] Problem with iTextSharp
On 2/18/2014 5:12 PM, Leonard Rosenthol wrote: There are no issues with iText No, but we made some minor changes in the latest release so that the behavior of keywords is more in line with what Adobe Reader expects. -- Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Re: [iText-questions] Problem with iTextSharp and SplitLate
Please post a small standalone runnable example exhibiting the problem. Paulo - Original Message - From: Whyall, Ben (Product Centre) ben.why...@logica.com To: itext-questions@lists.sourceforge.net Sent: Tuesday, December 01, 2009 5:10 PM Subject: [iText-questions] Problem with iTextSharp and SplitLate Hi I have a problem, when I am creating a pdf document which consists of lots of tables I get an object not set to an instance of an object error when trying to add to the document. This only occurs if SplitLate = false, else it works fine, though the table doesn’t split and then the document looks a little odd. Any ideas as to what I am doing wrong ? Thanks Ben Ben Whyall Senior Developer _ Logica 20 Kingston Road Staines Middlesex Surrey TW18 4LG T: +44 07590 600187 E: ben.why...@logica.commailto:ben.wh...@logica.com www.logica.comhttp://www.logica.com Logica UK Limited Registered in England and Wales (Registered number 947968) Registered office: 250 Brook Drive, Green Park, Reading, RG2 6UA, Uk Please help Logica to respect the environment by not printing this email / Pour contribuer comme Logica au respect de l'environnement, merci de ne pas imprimer ce mail / Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica dabei, die Umwelt zu sch?tzen. / Por favor ajude a Logica a respeitar o ambiente n?o imprimindo este correio electr?nico. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. -- Join us December 9, 2009 for the Red Hat Virtual Experience, a free event focused on virtualization and cloud computing. Attend in-depth sessions from your desk. Your couch. Anywhere. http://p.sf.net/sfu/redhat-sfdev2dev ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
Re: [iText-questions] Problem with ITextSharp PKSC7 Signing
Signatures are impossible to debug without being able to reproduce the problem and external signatures require a deep knowledge of what you are doing that is not related to iText. In your first question you didn't post code to reproduce both problems, in the second question teaching you how to encapsulate a PKCS1 in a PKCS7 is beyond the itext mailing list scope although you could get inspiration from the code in PdfPKCS7. Paulo -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of pchronos Sent: Tuesday, December 11, 2007 5:28 PM To: itext-questions@lists.sourceforge.net Subject: Re: [iText-questions] Problem with ITextSharp PKSC7 Signing Hi I have similar problems and no responses to both my posts... http://www.nabble.com/.NET-and-BC-signatures-to14235700.html http://www.nabble.com/pkcs1-to-pkcs7-external-signatures---to1 3803022.html#a13803022 Aviso Legal: Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
Re: [iText-questions] Problem with ITextSharp PKSC7 Signing
Paulo, Thank you for taking the time to respond to this issue. Please see my previous post which shows what I am doing. It is very strange that PKCS1 signatures verifies and PKCS7 does not with .NET. If I use BC crypto the reverse is true. http://www.nabble.com/pkcs1-to-pkcs7-external-signatures---to13803022.html#a13803022 I can also send you sample signed pfds if you wish. Thanks in advance for your help. Paulo Soares wrote: Signatures are impossible to debug without being able to reproduce the problem and external signatures require a deep knowledge of what you are doing that is not related to iText. In your first question you didn't post code to reproduce both problems, in the second question teaching you how to encapsulate a PKCS1 in a PKCS7 is beyond the itext mailing list scope although you could get inspiration from the code in PdfPKCS7. Paulo -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of pchronos Sent: Tuesday, December 11, 2007 5:28 PM To: itext-questions@lists.sourceforge.net Subject: Re: [iText-questions] Problem with ITextSharp PKSC7 Signing Hi I have similar problems and no responses to both my posts... http://www.nabble.com/.NET-and-BC-signatures-to14235700.html http://www.nabble.com/pkcs1-to-pkcs7-external-signatures---to1 3803022.html#a13803022 Aviso Legal: Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/ -- View this message in context: http://www.nabble.com/Problem-with-ITextSharp-PKSC7-Signing-tp14248734p14296038.html Sent from the iText - General mailing list archive at Nabble.com. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
Re: [iText-questions] Problem with ITextSharp PKSC7 Signing
BC code to get PKCS1 signature bytes using certificate with exported private key (pfxFilePath): string alias = null; Pkcs12Store pk12 = new Pkcs12Store(new FileStream(pfxFilePath, FileMode.Open, FileAccess.Read), password.ToCharArray()); IEnumerator en = pk12.Aliases.GetEnumerator(); while (en.MoveNext()) { alias = ((string)en.Current); if (pk12.IsKeyEntry(alias)) break; } AsymmetricKeyParameter akp = pk12.GetKey(alias).Key; Org.BouncyCastle.Crypto.Digests.Sha1Digest dig = new Org.BouncyCastle.Crypto.Digests.Sha1Digest(); Org.BouncyCastle.Crypto.Signers.RsaDigestSigner sig = new Org.BouncyCastle.Crypto.Signers.RsaDigestSigner(dig); sig.Init(true, akp); sig.BlockUpdate(hashToSign, 0, hashToSign.Length); byte[] extSig = sig.GenerateSignature(); .NET code I use RSACryptoServiceProvider with SHA1 and call SignHash() to get the PKCS1 signature. I then use iText's PdfPKS7 class to get the encoded signatures ( 1 or 7 ). PKCS1 verifies and PKCS7 does not. Paulo Soares wrote: Signatures are impossible to debug without being able to reproduce the problem and external signatures require a deep knowledge of what you are doing that is not related to iText. In your first question you didn't post code to reproduce both problems, in the second question teaching you how to encapsulate a PKCS1 in a PKCS7 is beyond the itext mailing list scope although you could get inspiration from the code in PdfPKCS7. Paulo -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of pchronos Sent: Tuesday, December 11, 2007 5:28 PM To: itext-questions@lists.sourceforge.net Subject: Re: [iText-questions] Problem with ITextSharp PKSC7 Signing Hi I have similar problems and no responses to both my posts... http://www.nabble.com/.NET-and-BC-signatures-to14235700.html http://www.nabble.com/pkcs1-to-pkcs7-external-signatures---to1 3803022.html#a13803022 Aviso Legal: Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/ -- View this message in context: http://www.nabble.com/Problem-with-ITextSharp-PKSC7-Signing-tp14248734p14296440.html Sent from the iText - General mailing list archive at Nabble.com. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
Re: [iText-questions] Problem with ITextSharp PKSC7 Signing
Hi I have similar problems and no responses to both my posts... http://www.nabble.com/.NET-and-BC-signatures-to14235700.html http://www.nabble.com/pkcs1-to-pkcs7-external-signatures---to13803022.html#a13803022 -- View this message in context: http://www.nabble.com/Problem-with-ITextSharp-PKSC7-Signing-tp14248734p14278685.html Sent from the iText - General mailing list archive at Nabble.com. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/