Quantcast

Not able to generate PDF from existing pdf with bar charts - Could not find the XObject named 'Im0'

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Not able to generate PDF from existing pdf with bar charts - Could not find the XObject named 'Im0'

maddyonline
Hello,

I am new to iText and using PdfReader, PdfStamper to read existing PDF document and trying to add watermarks and secure it. I am using the code below first to secure it. This is before I try to add watermark:


Security.addProvider(new BouncyCastleProvider());
PdfReader reader = new PdfReader(bin);
ByteArrayOutputStream bout=new ByteArrayOutputStream();
PdfStamper stp = PdfStamper.createSignature(reader, bout, '\0');
PdfSignatureAppearance sap = stp.getSignatureAppearance();
CertificateStore cs1=getStore();
sap.setCrypto(cs1.getPrivateKey(), cs1.getKeyChain(), null, PdfSignatureAppearance.SELF_SIGNED);
sap.setCertificationLevel(PdfSignatureAppearance.CERTIFIED_NO_CHANGES_ALLOWED);
// comment next line to have an invisible signature
stp.close();
return bout.toByteArray();

Problem I am facing is, when I try to modify existing document with bar charts and graphs, the program completes the process but when I try to open the newly generated file, I get below errors and file is empty. If i add watermark logic :

Error 1 - Could not find the XObject named 'Im0'

Error 2 - An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created PDF document to correct the problem.


But I don't get any problem if the pdf is plain text without images.
Can anyone please help? This is really critical and urgent for me. Any help is appreciated.
Thanks, Madhu
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Not able to generate PDF from existing pdf with bar charts - Could not find the XObject named 'Im0'

Paulo Soares-3
That's fixed in 5.0.4.
 
Paulo
----- Original Message -----
Sent: Monday, October 11, 2010 9:17 PM
Subject: [iText-questions] Not able to generate PDF from existing pdf with bar charts - Could not find the XObject named 'Im0'

Hello,

I am new to iText and using PdfReader, PdfStamper to read existing PDF document and trying to add watermarks and secure it. I am using the code below first to secure it. This is before I try to add watermark:


Security.addProvider(new BouncyCastleProvider());
PdfReader reader = new PdfReader(bin);
ByteArrayOutputStream bout=new ByteArrayOutputStream();
PdfStamper stp = PdfStamper.createSignature(reader, bout, '\0');
PdfSignatureAppearance sap = stp.getSignatureAppearance();
CertificateStore cs1=getStore();
sap.setCrypto(cs1.getPrivateKey(), cs1.getKeyChain(), null, PdfSignatureAppearance.SELF_SIGNED);
sap.setCertificationLevel(PdfSignatureAppearance.CERTIFIED_NO_CHANGES_ALLOWED);
// comment next line to have an invisible signature
stp.close();
return bout.toByteArray();

Problem I am facing is, when I try to modify existing document with bar charts and graphs, the program completes the process but when I try to open the newly generated file, I get below errors and file is empty. If i add watermark logic :

Error 1 - Could not find the XObject named 'Im0'

Error 2 - An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created PDF document to correct the problem.


But I don't get any problem if the pdf is plain text without images.
Can anyone please help? This is really critical and urgent for me. Any help is appreciated.
Thanks, Madhu


View this message in context: Not able to generate PDF from existing pdf with bar charts - Could not find the XObject named 'Im0'
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions

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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Not able to generate PDF from existing pdf with bar charts - Could not find the XObject named 'Im0'

maddyonline
Hi Paulo,
Thanks for your response.
I downloaded 5.0.4 jar and ran the prog. My modified pdf is still without images. Also what I see is, the bar chart axis is visible but the chart has disappeared in one case. Is this dependent on how the original pdf was created?
Can this be prob with image layers in pdf? Please help to resolve this issue.

Thanks,
Madhu


From: Paulo Soares <[hidden email]>
To: Post all your questions about iText here <[hidden email]>
Sent: Mon Oct 11 16:56:57 2010
Subject: Re: [iText-questions] Not able to generate PDF from existing pdf with bar charts - Could not find the XObject named 'Im0'

That's fixed in 5.0.4.
 
Paulo
----- Original Message -----
Sent: Monday, October 11, 2010 9:17 PM
Subject: [iText-questions] Not able to generate PDF from existing pdf with bar charts - Could not find the XObject named 'Im0'

Hello,

I am new to iText and using PdfReader, PdfStamper to read existing PDF document and trying to add watermarks and secure it. I am using the code below first to secure it. This is before I try to add watermark:


Security.addProvider(new BouncyCastleProvider());
PdfReader reader = new PdfReader(bin);
ByteArrayOutputStream bout=new ByteArrayOutputStream();
PdfStamper stp = PdfStamper.createSignature(reader, bout, '\0');
PdfSignatureAppearance sap = stp.getSignatureAppearance();
CertificateStore cs1=getStore();
sap.setCrypto(cs1.getPrivateKey(), cs1.getKeyChain(), null, PdfSignatureAppearance.SELF_SIGNED);
sap.setCertificationLevel(PdfSignatureAppearance.CERTIFIED_NO_CHANGES_ALLOWED);
// comment next line to have an invisible signature
stp.close();
return bout.toByteArray();

Problem I am facing is, when I try to modify existing document with bar charts and graphs, the program completes the process but when I try to open the newly generated file, I get below errors and file is empty. If i add watermark logic :

Error 1 - Could not find the XObject named 'Im0'

Error 2 - An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created PDF document to correct the problem.


But I don't get any problem if the pdf is plain text without images.
Can anyone please help? This is really critical and urgent for me. Any help is appreciated.
Thanks, Madhu


View this message in context: Not able to generate PDF from existing pdf with bar charts - Could not find the XObject named 'Im0'
Sent from the iText - General mailing list archive at Nabble.com.

Disclaimer link. To see it, click the link below, or copy and paste it into your browser's address line. http://www.citco.com/emaildisclaimer.htm


------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions

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
Loading...