Re: [iText-questions] Determining the indirect reference of undercontent or overcontent

2012-09-25 Thread 1T3XT BVBA
On 25/09/2012 2:51, billya wrote: Is my question too complicated? From a technical point of view (the 'literal' question): probably not. From an architectural point of view (the design): I'm not inclined to answer. I just want to be able to get the indirect reference of undercontent (a

Re: [iText-questions] Using peoplecode and itext to convert jpgs to pdf but need help with image alignment

2012-09-25 Thread 1T3XT BVBA
On 24/09/2012 19:50, georgetv wrote: was wondering if there's some way of aligning multiple images on the same page to better utilize each page and keep the number of pages to a minimum. That's purely a Math problem, isn't it? If not, please clarify.

[iText-questions] Using iTextSharp to write data to PDF works great, but Acrobat Reader asks 'Do you want to save changes' when closing file

2012-09-25 Thread Moore, Marc
I'm using iTextSharp 5.3.2.0 to add information to an existing PDF file that contains a W-2 form. Everything is working perfectly and the PDF file looks great when written into the browser's response stream; however, when the user is done looking at the PDF, he is asked Do you want to save changed

Re: [iText-questions] Using iTextSharp to write data to PDF works great, but Acrobat Reader asks 'Do you want to save changes' when closing file

2012-09-25 Thread 1T3XT BVBA
On 24/09/2012 19:15, Moore, Marc wrote: My conclusion is that iTextSharp is doing something bad to the PDF in the process of opening it and writing the bytes to the stream I fixed a similar problem a while ago. iText wasn't doing something bad, there already was 'something bad' in the PDF. This

[iText-questions] [SPAM] Re: Using iTextSharp to write data to PDF works great, but Acrobat Reader asks 'Do you want to save changes' when closing file

2012-09-25 Thread mkl
Marc, Moore, Marc wrote PdfReader pdfReader = new PdfReader(dataSource.ReportTemplate); using(MemoryStream outputStream = new MemoryStream()) using (PdfStamper pdfStamper = new PdfStamper(pdfReader, outputStream)) {

[iText-questions] iTextSharp digital signature using smart card

2012-09-25 Thread sanduche
I would like to sign pdf using iTextSharp and smart card. PrivateKeySignature constructor requires Org.BouncyCastle.Crypto.IICipherParameters object but I don't know how to create it from X509Certificate2.PrivateKey. I found examples which are using BC and PKCS12/DotNet for converting but none

Re: [iText-questions] iTextSharp digital signature using smart card

2012-09-25 Thread 1T3XT BVBA
On 25/09/2012 11:13, sanduche wrote: I would like to sign pdf using iTextSharp and smart card. PrivateKeySignature constructor requires Org.BouncyCastle.Crypto.IICipherParameters object but I don't know how to create it from X509Certificate2.PrivateKey. I found examples which are using BC and

Re: [iText-questions] Help nedded - digital signature error : BigInteger: modulus not positive,

2012-09-25 Thread 1T3XT BVBA
On 25/09/2012 11:15, NVS wrote: all test certificates are working fine with itextpdf, where as trying trusted certificates are not working properly with itextpdf libarary We can't reproduce this with a GlobalSign certificate. See http://itextpdf.com/book/digitalsignatures

[iText-questions] XML worker fonts

2012-09-25 Thread John Renfrew
Is there a method to register a from bytes or a stream rather than disk in the XMLWorkerFontProvider()?? Did I miss a bit of the API or documentation? john renfrew Right Way Up Office +44 1675 475341 -- Live

Re: [iText-questions] Using peoplecode and itext to convert jpgs to pdf but need help with image alignment

2012-09-25 Thread georgetv
:-) This would be the wrong forum if it were. I was wondering if there was a way I could read all the jpgs and paste them in the pdf to have multiple images on the same page. The way I have it now, each jpg gets its own page. -- View this message in context:

Re: [iText-questions] Determining the indirect reference of undercontent or overcontent

2012-09-25 Thread billya
Thanks for your response. The reason I initially thought of using object numbers was because I thought that object numbers would get updated by conforming pdf writers. So that if changes are made to an object number, the object itself has it's number changed. Or vice versa if an object's number

Re: [iText-questions] iTextSharp digital signature using smart card

2012-09-25 Thread sanduche
Java implementation uses regular KeyStore to acces MSCAPI functionality and PrivateKeySignature constructor accepts PrivateKey available from Keystore. C# implementation behaves in different way. I can use standard .NET libraries to access MSCAPI and get X509Certificate2 object that has

Re: [iText-questions] Using peoplecode and itext to convert jpgs to pdf but need help with image alignment

2012-09-25 Thread iText Info
Op 25/09/2012 13:02, georgetv schreef: I was wondering if there was a way I could read all the jpgs and paste them in the pdf to have multiple images on the same page. Of course, that's certainly possible! The way I have it now, each jpg gets its own page. The line above is the one I don't

Re: [iText-questions] Determining the indirect reference of undercontent or overcontent

2012-09-25 Thread iText Info
Op 25/09/2012 13:04, billya schreef: To elaborate a little more about what I am doing, I am adding something similar to a watermark to specific pages and resizing the existing page content so that the watermark does not appear on top of the existing content. I would create the Watermark as an

Re: [iText-questions] iTextSharp digital signature using smart card

2012-09-25 Thread iText Info
Op 25/09/2012 13:15, sanduche schreef: C# implementation behaves in different way. I can use standard .NET libraries to access MSCAPI and get X509Certificate2 object that has PrivateKey. Problem is that I don't know how to cast/convert/create Org.BouncyCastle.Crypto.IICipherParameters from

Re: [iText-questions] SetSimpleCOlumn not line wrapping!

2012-09-25 Thread iText Info
Op 25/09/2012 13:24, d347hm4n schreef: I appreciate that I am doing something wrong here as Itext should be able to handle the wrapping and how much space text may need on the page itself, but I am unable to figure out how to use it. Can you try this with a different font? Do you get the same

Re: [iText-questions] Help nedded - digital signature error : BigInteger: modulus not positive,

2012-09-25 Thread iText Info
Op 25/09/2012 13:42, NVS schreef: my pkcs p12 file verisign trail one, can any one sign the pdf with this keystore file, password is *nvsverisign* I tried signing a document with that p12 file with iText; I tried signing a document with that p12 with Acrobat. I've even tried importing the

Re: [iText-questions] SetSimpleCOlumn not line wrapping!

2012-09-25 Thread d347hm4n
Can you try this with a different font? Do you get the same result? I see that you create a Phrase without specifying a leading (leading = the space between the lines). In this case, the default leading depends on the font size. What is shown in your result looks like a text that is written

Re: [iText-questions] SetSimpleCOlumn not line wrapping!

2012-09-25 Thread iText Info
Op 25/09/2012 14:43, d347hm4n schreef: The more you know. ;-) Thanks for the feedback! -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed

Re: [iText-questions] iTextSharp digital signature using smart card

2012-09-25 Thread sanduche
I would say that this is C# and iTextSharp problem (not supporting digital signatures out of box with built in classes). Anyway I solved problem with custom implementation of IExternalSignature interface, which uses only standard .NET classes for signing. -- View this message in context:

Re: [iText-questions] iTextSharp digital signature using smart card

2012-09-25 Thread Paulo Soares
There's already a class to do that called X509Certificate2Signature.cs. Paulo On Tue, Sep 25, 2012 at 2:09 PM, sanduche sandu...@gmail.com wrote: I would say that this is C# and iTextSharp problem (not supporting digital signatures out of box with built in classes). Anyway I solved problem

Re: [iText-questions] Using peoplecode and itext to convert jpgs to pdf but need help with image alignment

2012-09-25 Thread georgetv
-The line above is the one I don't understand. Why would you write code -that puts one JPG on one page if you want to add multiple JPGs to a -single page??? Because I don't know how to put multiple JPGS on a single PDF page mainly. -MY question is: how do you want to organize the images? Do

Re: [iText-questions] Help nedded - digital signature error : BigInteger: modulus not positive,

2012-09-25 Thread iText Info
Op 25/09/2012 16:45, NVS schreef: Hi, Are there any one get signed PDF document with itextpdf library with any trusted certificate provided by any CA or authority etc.. like verisign keystore file. Yes, it is possible to use iText to sign a document using trusted certificates provided by

Re: [iText-questions] Using peoplecode and itext to convert jpgs to pdf but need help with image alignment

2012-09-25 Thread iText Info
Op 25/09/2012 16:31, georgetv schreef: Can I organize based on the size of the image, if there is space for more than one add more if not use the next next page ? That's a Math question! You told me explicitly your question wasn't about Math! You say you don't know how to put multiple JPGs on

Re: [iText-questions] Using iTextSharp to write data to PDF works great, but Acrobat Reader asks 'Do you want to save changes' when closing file

2012-09-25 Thread Marc Moore
More Data: The original PDF used as a template is approximately 80K in size. If I look at the temporary file that's been streamed down through my browser, the PDF file written by iTextSharp is approximately 150K. However, when I answer Yes to the Save Changes question asked by Acrobat Reader, the

Re: [iText-questions] Using iTextSharp to write data to PDF works great, but Acrobat Reader asks 'Do you want to save changes' when closing file

2012-09-25 Thread iText Info
Op 25/09/2012 17:22, Marc Moore schreef: More Data: The original PDF used as a template is approximately 80K in size. If I look at the temporary file that's been streamed down through my browser, the PDF file written by iTextSharp is approximately 150K. However, when I answer Yes to the

Re: [iText-questions] Using peoplecode and itext to convert jpgs to pdf but need help with image alignment

2012-09-25 Thread iText Info
It's worse than I thought. I don't know what language your code sample is in, but as far as I understand it, you're creating a separate file for each image! What do you expect from us? You say you have no Java skills? Does that mean you want us to write your code in your place? For free?

Re: [iText-questions] Using peoplecode and itext to convert jpgs to pdf but need help with image alignment

2012-09-25 Thread georgetv
1T3XT BVBA wrote It's worse than I thought. I don't know what language your code sample is in, but as far as I understand it, you're creating a separate file for each image! What do you expect from us? You say you have no Java skills? Does that mean you want us to write your code in

Re: [iText-questions] Using iTextSharp to write data to PDF works great, but Acrobat Reader asks 'Do you want to save changes' when closing file

2012-09-25 Thread Marc Moore
Without seeing the PDF, I can't tell you anything more. I'm certainly willing to send it to you if you'd look at it! -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and

Re: [iText-questions] [SPAM] Re: Using iTextSharp to write data to PDF works great, but Acrobat Reader asks 'Do you want to save changes' when closing file

2012-09-25 Thread Marc Moore
Are you properly closing the stamper? Maybe it simply had not finished writing to the memory stream when its bytes were returned... I had explicit closes of the stamper and the memory stream when I first noticed the problem. After looking at some other folks' code I introduced the usings, but

[iText-questions] [SPAM] Re: [SPAM] Re: Using iTextSharp to write data to PDF works great, but Acrobat Reader asks 'Do you want to save changes' when closing file

2012-09-25 Thread mkl
Marc, [properly closing the stamper] Moore, Marc wrote I had explicit closes of the stamper and the memory stream when I first noticed the problem. After looking at some other folks' code I introduced the usings, but there was no change in behavior. I'd be happy to change it back if it would

Re: [iText-questions] Using iTextSharp to write data to PDF works great, but Acrobat Reader asks 'Do you want to save changes' when closing file

2012-09-25 Thread Marc Moore
iText wasn't doing something bad, there already was 'something bad' in the PDF. This was fixed by removing that 'something bad'. I hope to get Acrobat Pro installed and poke around the PDF a bit. It may be naive, but I'm hoping that simply saving the PDF in Acrobat will straighten it out.

Re: [iText-questions] [SPAM] Re: [SPAM] Re: Using iTextSharp to write data to PDF works great, but Acrobat Reader asks 'Do you want to save changes' when closing file

2012-09-25 Thread Marc Moore
I have heard, though, that some people return MemoryStream.GetBuffer to the client as response; this would be incorrect as the buffer may contain additional, uninitialized data. Really? That's what I'm doing! What would be the alternative? I would think that the stream would contain only the

Re: [iText-questions] [SPAM] Re: [SPAM] Re: Using iTextSharp to write data to PDF works great, but Acrobat Reader asks 'Do you want to save changes' when closing file

2012-09-25 Thread Marc Moore
New code: public MemoryStream MergeDataByDrawing(int copies) { PdfReader pdfReader = new PdfReader(reportTemplate); pdfReader.Catalog.Remove(PdfName.ACROFORM); using (MemoryStream outputStream = new MemoryStream()) using (PdfStamper pdfStamper = new PdfStamper(pdfReader,

Re: [iText-questions] [SPAM] Re: [SPAM] Re: Using iTextSharp to write data to PDF works great, but Acrobat Reader asks 'Do you want to save changes' when closing file

2012-09-25 Thread Marc Moore
you maybe should take a different approach and first try what happens if you save the MemoryStream contents to harddisc and then try to open that file directly. If you observe the same issue, please post that file here. I've done this and I do observe the same issue when I open the saved PDF

Re: [iText-questions] Using iTextSharp to write data to PDF works great, but Acrobat Reader asks 'Do you want to save changes' when closing file

2012-09-25 Thread Marc Moore
Non-working: public byte[] MergeDataByDrawing(int copies) { PdfReader pdfReader = new PdfReader(reportTemplate); using (MemoryStream outputStream = new MemoryStream()) using (PdfStamper pdfStamper = new PdfStamper(pdfReader, outputStream)) { // flatten the form to remove

Re: [iText-questions] [SPAM] Re: [SPAM] Re: Using iTextSharp to write data to PDF works great, but Acrobat Reader asks 'Do you want to save changes' when closing file

2012-09-25 Thread Marc Moore
Non-working: public byte[] MergeDataByDrawing(int copies) { PdfReader pdfReader = new PdfReader(reportTemplate); using (MemoryStream outputStream = new MemoryStream()) using (PdfStamper pdfStamper = new PdfStamper(pdfReader, outputStream)) { // flatten the form to remove

Re: [iText-questions] Using iTextSharp to write data to PDF works great, but Acrobat Reader asks 'Do you want to save changes' when closing file

2012-09-25 Thread Paulo Soares
GetBuffer() is the internal working array and is always larger than the actual data size. ToArray() will make a buffer copy with only the data byte, that's why it's the correct way to do it. I would be more comfortable with the ToArray() outside the 'using' statement. Paulo On Tue, Sep 25, 2012