[iText-questions] Extract jpeg image color problem

2010-01-27 Thread Jan Vosloo
Hi

I can successfully extract a jpeg image from a PDF document, but the color
is all messed up.

Any help would be appreciated
Thanks
--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com___
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/

[iText-questions] ava.lang.RuntimeException: only FONT/SIZE/UNDERLINE/ SUPERSCRIPT supported

2010-01-27 Thread Himanshu Ahluwalia
i am creating a pdf using iText-2.1.4.jar.. its working fine for my
linux fedora and Centos (Redhat releases ) Operating Systems .but its
giving following exception in case of other Linux OS say  (Suse Linux )

12:29:08,501 ERROR [STDERR] java.lang.RuntimeException: only
FONT/SIZE/UNDERLINE/
SUPERSCRIPT supported
12:29:08,501 ERROR [STDERR] at
com.lowagie.text.pdf.PdfGraphics2D.doAttributes(PdfGraphics2D.java:321)
12:29:08,501 ERROR [STDERR] at
com.lowagie.text.pdf.PdfGraphics2D.drawString(PdfGraphics2D.java:407)
12:29:08,501 ERROR [STDERR] at
org.compiere.print.layout.TableElement.printColumn(TableElement.java:1284)
12:29:08,501 ERROR [STDERR] at
org.compiere.print.layout.TableElement.paint(TableElement.java:1153)
12:29:08,501 ERROR [STDERR] at
org.compiere.print.layout.Page.paint(Page.java:166)
12:29:08,501 ERROR [STDERR] at
org.compiere.print.layout.LayoutEngine.print(LayoutEngine.java:1776)
12:29:08,501 ERROR [STDERR] at
org.compiere.pdf.Document.writePDF(Document.java:69)
12:29:08,501 ERROR [STDERR] at
org.compiere.pdf.Document.getPDFAsArray(Document.java:95)
12:29:08,501 ERROR [STDERR] at
org.compiere.print.ReportEngine.createPDFData(ReportEngine.java:860)
12:29:08,501 ERROR [STDERR] at
org.adempiere.webui.window.ZkReportViewer.jbInit(ZkReportViewer.java:242)
12:29:08,502 ERROR [STDERR] at
org.adempiere.webui.window.ZkReportViewer.(ZkReportViewer.java:161)
12:29:08,502 ERROR [STDERR] at
org.adempiere.webui.window.ZkReportViewerProvider.openViewer(ZkReportViewerProvider.java:32)
12:29:08,502 ERROR [STDERR] at
org.compiere.print.ReportCtl.preview(ReportCtl.java:253)


is it due to Graphics Problem ? please clarify??

Regards
Himanshu Walia
9780552519
--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com___
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/

[iText-questions] Validating an uploaded PDF?

2010-01-27 Thread Roeder, Andreas
Hi,

I want to validate a PDF uploaded by a user. It contains a scanned document. 
The document should be:

--> PDF-Specification 1.0, 1.1, 1.2, 1.3 or 1.4 
--> All fonts and Logos must be embedded or it has to be an Image PDF 
(PDF/A black/white)
--> resolution 300x300 dpi 
--> page format DIN A4
--> all pages black/white (no greyscale,  no colours)
--> max 999 pages 
--> optional: compression CCITT G3, G4

Is that possible to validate that with iText? If yes, how can I do that?

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com___
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] Extract jpeg image color problem

2010-01-27 Thread Mike Marchywka



Since no on else replied, 




> Date: Wed, 27 Jan 2010 12:58:57 +0200
> From: 
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] Extract jpeg image color problem
>
> Hi
>
> I can successfully extract a jpeg image from a PDF document, but the color is 
> all messed up.

Did you do this with itext? In any case can you post some code? 
>
> Any help would be appreciated

It depends what you mean by messed up. I'll assume this is not a well known 
issue so some
details may help. In particular, is color map shifted through entire image ( 
r->g for example)
or does it change on each line? I've seen this a lot with various image formats 
and lines
with non-mod-N length since padding specs are often ambiguous and lower level
code may just do whatever machine does. Is this a 64 bit machine for example?

I think now that you mention it I may have seen rendered pages from the open 
source viewer
I used have color shifts (uniform color table change that looks like an 
off-by-one RGB alignment issue).
I'm used to seeing this from various sources and wasn't important at the time 
so I didn't
track it down. I have noted that different image viewers can display the same 
jpg ( presumably it is not 
quite right but still a jpg LOL) differently
too, have you tried different viewers or examined the jpg bytes to see what it 
should look like?


> Thanks
  
_
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
http://clk.atdmt.com/GBL/go/196390709/direct/01/
--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
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/


[iText-questions] Search in PDF

2010-01-27 Thread EBCTO

HI,
I am converting SVG to PDF through org.apache.fop.svg.pdftranscoder.

I am obtaining the PDF output correctly.
But the search option inside PDF is not working.
In the PDF I obtained,  the words inside the text tag(while designing SVG)
are searchable, but not the words inside flowpara tag.

What may be the reason ?
-- 
View this message in context: 
http://old.nabble.com/Search-in-PDF-tp27339739p27339739.html
Sent from the iText - General mailing list archive at Nabble.com.


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
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/


[iText-questions] iText Examples

2010-01-27 Thread Dave Gilbert
Just a quick question. I Just purchased your early release of the 2nd
edition book. As I was following the examples I noticed some of the classes
of iText have been removed in 5.0. (html writer, rtfwriter, etc.)
Being new to iText I was hoping you could point me in the right direction to
download the examples and source that were used in the iText 1st edition.
Since the 2nd edition is not yet complete I'd like to continue with more
advanced examples from the 1st book, and transition over to 5.0 as I become
more familiar with the complete functionality of iText

Thank you for your help,

Dave
--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com___
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] iText Examples

2010-01-27 Thread 1T3XT info
Dave Gilbert wrote:
> Just a quick question. I Just purchased your early release of the 2nd 
> edition book. As I was following the examples I noticed some of the 
> classes of iText have been removed in 5.0. (html writer, rtfwriter, etc.)
> Being new to iText I was hoping you could point me in the right 
> direction to download the examples and source that were used in the 
> iText 1st edition. Since the 2nd edition is not yet complete I'd like to 
> continue with more advanced examples from the 1st book, and transition 
> over to 5.0 as I become more familiar with the complete functionality of 
> iText

Everything can be found in the SVN repository at SourceForge.
You can download tarballs with complete bundles (look for the link
"download GNU Tarball").

Resources for the second edition (iText 5.x.y):
http://itext.svn.sourceforge.net/viewvc/itext/book/
Resources for the first edition (iText 2.x.y):
http://itext.svn.sourceforge.net/viewvc/itext/examples/

Old releases can be found here:
http://sourceforge.net/projects/itext/files/
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
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] Search in PDF

2010-01-27 Thread 1T3XT info
EBCTO wrote:
> HI,
> I am converting SVG to PDF through org.apache.fop.svg.pdftranscoder.
> 
> I am obtaining the PDF output correctly.
> But the search option inside PDF is not working.
> In the PDF I obtained,  the words inside the text tag(while designing SVG)
> are searchable, but not the words inside flowpara tag.
> 
> What may be the reason ?

Why are you asking this on an iText mailing list when you're not even 
using iText? Please ask the FOP people at Apache what could be causing 
the problem.
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
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] Pdf signature validation

2010-01-27 Thread Sérgio Onofre
I can validate it with reader, as Acrobat. But I try to develop a validator 
with itext and doesn’t work…

 

Onofre

 

 

From: Mathieu Fortin [mailto:mathieu.for...@notarius.com] 
Sent: terça-feira, 26 de Janeiro de 2010 18:29
To: itext-questions@lists.sourceforge.net
Subject: Re: [iText-questions] Pdf signature validation

 

Ocsp is used for long term validation. In order to use it, you have to embed 
the ocsp info in the pdf AND your signature provider must have the ocsp server 
component up and running.

But still, without ocsp/embedded crl you should be able to validate the pdf in 
reader on whatever computer.

Can you post the pdf? 


Notarius Inc. 
700-1080 Côte du Beaver Hall 
Montréal, Québec, H2Z 1S8 

Avis de confidentialité / Confidentiality Notice 

Notarius Inc. - Certifié ISO 9001 : 2000 
Centre de certification du Québec - Certifié ISO 27001 : 2005 



  _  

From: Sérgio Onofre 
To: itext-questions@lists.sourceforge.net 
Sent: Tue Jan 26 09:36:42 2010
Subject: [iText-questions] Pdf signature validation 

Hi,

 

I’m using itext to sign pdf documents with smart cards certificates 
and it Works fine. 

 

The problem I have is verifying the signatures throw the itext in 
Java. It only works in the computer where is installed the smart-card. I see 
that Acrobat Reader uses OCSP connection to validate the signature, how I can 
use also a connection to validate it?

 

Thanks 

Onofre

 

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com___
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] Pdf signature validation

2010-01-27 Thread Mathieu Fortin
It would help if you could post your validation code.

 



De : Sérgio Onofre [mailto:ono...@holos.pt] 
Envoyé : January 27, 2010 12:59 PM
À : 'Post all your questions about iText here'
Objet : Re: [iText-questions] Pdf signature validation

 

I can validate it with reader, as Acrobat. But I try to develop a validator 
with itext and doesn't work...

 

Onofre

 

 

From: Mathieu Fortin [mailto:mathieu.for...@notarius.com] 
Sent: terça-feira, 26 de Janeiro de 2010 18:29
To: itext-questions@lists.sourceforge.net
Subject: Re: [iText-questions] Pdf signature validation

 

Ocsp is used for long term validation. In order to use it, you have to embed 
the ocsp info in the pdf AND your signature provider must have the ocsp server 
component up and running.

But still, without ocsp/embedded crl you should be able to validate the pdf in 
reader on whatever computer.

Can you post the pdf? 


Notarius Inc. 
700-1080 Côte du Beaver Hall 
Montréal, Québec, H2Z 1S8 

Avis de confidentialité / Confidentiality Notice 

Notarius Inc. - Certifié ISO 9001 : 2000 
Centre de certification du Québec - Certifié ISO 27001 : 2005 



From: Sérgio Onofre 
To: itext-questions@lists.sourceforge.net 
Sent: Tue Jan 26 09:36:42 2010
Subject: [iText-questions] Pdf signature validation 

Hi,

 

I'm using itext to sign pdf documents with smart cards certificates 
and it Works fine. 

 

The problem I have is verifying the signatures throw the itext in 
Java. It only works in the computer where is installed the smart-card. I see 
that Acrobat Reader uses OCSP connection to validate the signature, how I can 
use also a connection to validate it?

 

Thanks 

Onofre

 

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com___
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/

[iText-questions] Nested Table Background Overflowing

2010-01-27 Thread Don
I am trying to nest a table within the cell of another table with the goal of 
having some of the background of the outer table show around the table being 
nested.  Here is the basic idea:

PdfPTable outerTable = new PdfPTable(5);
...

PdfPTable nestedTable = new PdfPTable(1);
PdfPCell nestedCell = new PdfPCell(text, font);
nestedCell.setBackgroundColor(background);
nestedTable.addCell(nestedCell);

PdfPCell outerCell = new PdfPCell(nestedTable);
outerCell.setBackgroundColor(differentBackground);
outerCell.setPadding(2);
outerTable.addCell(outerCell);
...

The problem I am running into is that the background color of the nested cell 
is running over into the background of the outer table and all the way to the 
end of the page.  Am I doing something wrong?

Thanks for the help.

-Don



--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
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/


[iText-questions] "Unknown Source" is such a bad thing?

2010-01-27 Thread Cameron Laird
After considerable effort, we narrowed down a symptom in a much larger
system to this traceback:
java.lang.NullPointerException
   at com.lowagie.text.pdf.SimpleBookmark.bookmarkDepth(Unknown Source)
   at com.lowagie.text.pdf.SimpleBookmark.getBookmark(Unknown Source)
   at com.lowagie.tools.concat_pdf.main(Unknown Source)
from, in effect, an invocation of
 java -cp /usr/share/java/itext.jar com.lowagie.tools.concat_pdf L1.pdf
O1.pdf
This is 1.4.5 of iText.

What are my prospects?  L1.pdf is a 52-page instance that *looks* OK at a
casual glance. It's probable that L1.pdf is the output from HTMLDOC
operations.  I suspect I can cut L1.pdf down more to probably just a few
crucial pages that yield the NullPointerException.  I'm open to advice,
though:
A.  Is there any reason to think that someone else is already working on
this fault?
B.  Is there any way I can pre-process L1.pdf or invoke iText differently so
that the two get along better?
C.  Is there someone else who'd like to tackle this?  Pay is possible, if
that makes a difference.
--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com___
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] Validating an uploaded PDF?

2010-01-27 Thread Leonard Rosenthol
You should go purchase one of the myriad of PDF analyzers or preflight tools 
for this job – problem has been solved, no need to reinvent the wheel.

Leonard

From: Roeder, Andreas [mailto:andreas.roe...@firstdata.de]
Sent: Wednesday, January 27, 2010 6:17 AM
To: itext-questions@lists.sourceforge.net
Subject: [iText-questions] Validating an uploaded PDF?


Hi,

I want to validate a PDF uploaded by a user. It contains a scanned document. 
The document should be:

--> PDF-Specification 1.0, 1.1, 1.2, 1.3 or 1.4
--> All fonts and Logos must be embedded or it has to be an Image PDF 
(PDF/A black/white)
--> resolution 300x300 dpi
--> page format DIN A4
--> all pages black/white (no greyscale,  no colours)
--> max 999 pages
--> optional: compression CCITT G3, G4

Is that possible to validate that with iText? If yes, how can I do that?
--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com___
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] Extract jpeg image color problem

2010-01-27 Thread Leonard Rosenthol
In addition, was the image in RGB, CMYK or Gray colorspace in the PDF?  What 
colorspace did you write it out as?

-Original Message-
From: Mike Marchywka [mailto:marchy...@hotmail.com] 
Sent: Wednesday, January 27, 2010 9:51 AM
To: itext-questions@lists.sourceforge.net
Subject: Re: [iText-questions] Extract jpeg image color problem




Since no on else replied, 




> Date: Wed, 27 Jan 2010 12:58:57 +0200
> From: 
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] Extract jpeg image color problem
>
> Hi
>
> I can successfully extract a jpeg image from a PDF document, but the color is 
> all messed up.

Did you do this with itext? In any case can you post some code? 
>
> Any help would be appreciated

It depends what you mean by messed up. I'll assume this is not a well known 
issue so some
details may help. In particular, is color map shifted through entire image ( 
r->g for example)
or does it change on each line? I've seen this a lot with various image formats 
and lines
with non-mod-N length since padding specs are often ambiguous and lower level
code may just do whatever machine does. Is this a 64 bit machine for example?

I think now that you mention it I may have seen rendered pages from the open 
source viewer
I used have color shifts (uniform color table change that looks like an 
off-by-one RGB alignment issue).
I'm used to seeing this from various sources and wasn't important at the time 
so I didn't
track it down. I have noted that different image viewers can display the same 
jpg ( presumably it is not 
quite right but still a jpg LOL) differently
too, have you tried different viewers or examined the jpg bytes to see what it 
should look like?


> Thanks
  
_
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
http://clk.atdmt.com/GBL/go/196390709/direct/01/
--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
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/

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
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/


[iText-questions] Type3Font not displaying correctly with showtext()

2010-01-27 Thread Hans Petrich
I've been working on a simple test case to show "Hello World" on the pdf
document using a custom type3Font.  I have defined my own type 3 font using
bitmaps and masked images.  When I use Document.add(new Paragraph("Hello
World", Type3Font)), the text shows up just fine.  The problem comes when
trying to use the showText("Hello World") when using the type3Font.  All it
displays are dots with an error stating "cannot extract the embedded font
'T3Font_1'. Some characters may not display or print correctly."   Does
iText not support type3Fonts with the showText() method?
Here's the test code:


public class Type3Characters {

static Type3Font _t4;
static PdfContentByte _g;
static Document document;

public static void tryme(char letter, byte[] maskr, Image chars){
try {

chars = Image.getInstance(8, 8, 1, 1, maskr);
chars.makeMask();
_g = _t4.defineGlyph(letter, 900, 0, 0, 1200, 1200);

_g.addImage(chars, 1200, 0, 0, 1200, 0, 0);
boolean success = false;
//g2.drawLine(_t4, 50, 50);

} catch (Exception e1) {
e1.printStackTrace();
}
}
document = new Document();
try {

PdfWriter writer = PdfWriter.getInstance(document, new
FileOutputStream("type4.pdf"));

document.open();

_t4 = new Type3Font(writer, new char[]{' ', 'H', 'e', 'l', 'o',
'W', 'r', 'd'},false);
_g = _t4.defineGlyph(' ', 300, 0, 0, 1200, 1200);

byte maskrO[] = {(byte)0x3c, (byte)0x7e, (byte)0xe7, (byte)0xc3,
(byte)0xc3, (byte)0xe7, (byte)0x7e, (byte)0x3c};
Image charO = null;
tryme('O', maskrO, charO);

byte[] maskrH = {(byte)0xbd, (byte)0xbd, (byte)0xbd, (byte)0x81,
(byte)0xbd, (byte)0xbd, (byte)0xbd, (byte)0xbd};
Image charH = null;
tryme('H', maskrH, charH);

byte[] maskrW = {(byte)0x7e, (byte)0x7e, (byte)0x7e, (byte)0xbd,
(byte)0xbd, (byte)0xa5, (byte)0xdb, (byte)0xdb};
Image charW = null;
tryme('W', maskrW, charW);

byte[] maskre = {(byte)0xff, (byte)0xff, (byte)0xff, (byte)0xe7,
(byte)0xdb, (byte)0xc3, (byte)0xdf, (byte)0xe3};
Image chare = null;
tryme('e', maskre, chare);

byte[] maskro = {(byte)0xff, (byte)0xff, (byte)0xff, (byte)0xe7,
(byte)0xdb, (byte)0xdb, (byte)0xdb, (byte)0xe7};
Image charo = null;
tryme('o', maskro, charo);

byte[] maskrr = {(byte)0xff, (byte)0xff, (byte)0xff, (byte)0xd3,
(byte)0xcf, (byte)0xdf, (byte)0xdf, (byte)0xdf};
Image charr = null;
tryme('r', maskrr, charr);

byte[] maskrl = {(byte)0xf7, (byte)0xf7, (byte)0xf7, (byte)0xf7,
(byte)0xf7, (byte)0xf7, (byte)0xf7, (byte)0xf7};
Image charl = null;
tryme('l', maskrl, charl);

byte[] maskrd = {(byte)0xfb, (byte)0xfb, (byte)0xfb, (byte)0xe3,
(byte)0xdb, (byte)0xdb, (byte)0xdb, (byte)0xe3};
Image chard = null;
tryme('d', maskrd, chard);


Font font1 = new Font(_t4, 12);

// So this piece of code works in putting the text to the pdf
document.add(new Paragraph("HelloWorld", font1));

// But this code does not

_g.beginText();
_g.setFontAndSize(_t4, 12);
_g.setTextMatrix(50, 50);
 _g.showText("Hello World");
_g.endText();

} catch (Exception de) {
System.err.println(de.getMessage());
}

document.close();
}
--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com___
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] Extract jpeg image color problem

2010-01-27 Thread Leonard Rosenthol
Image is CMYK in the PDF you aren't considering that.  In addition, you are not 
dealing with the Decode params nor the "Photoshop CMYK Inversion" 
implementation note.

Leonard

From: Jan Vosloo [mailto:jevos...@gmail.com]
Sent: Wednesday, January 27, 2010 3:39 PM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Extract jpeg image color problem

Thanks for the reply. The image is RGB (or that's what I think). I'm actually 
using C# (itextsharp), but tried java with same result. Please have a look at 
the test code snippet:

public void itext()
{
string pdfPath = "c:\\temp\\pdf\\1.pdf";
string outputPath = "c:\\temp\\pdf\\img.";
PdfReader pdfReader = new 
PdfReader(pdfPath);
int size = pdfReader.XrefSize;
for (int i = 0; i < size; i++)
{
PdfObject obj = 
pdfReader.GetPdfObject(i);
if (obj != null && 
obj.IsStream())
{
PdfDictionary pDic 
= (PdfDictionary)obj;
if 
(pDic.Contains(PdfName.SUBTYPE) && pDic.Get(PdfName.SUBTYPE).ToString() == 
"/Image")
{
string 
filter = pDic.Get(PdfName.FILTER).ToString();
string 
width = pDic.Get(PdfName.WIDTH).ToString();
string 
height = pDic.Get(PdfName.HEIGHT).ToString();
string 
bpp = pDic.Get(PdfName.BITSPERCOMPONENT).ToString();
// TODO 
pixel format
byte[] 
arr;
Bitmap 
bmp;
switch 
(filter)
{

case "/FlateDecode":

arr = 
PdfReader.FlateDecode(PdfReader.GetStreamBytesRaw((PRStream)obj), true);

using (bmp = new Bitmap(Int32.Parse(width), 
Int32.Parse(height), PixelFormat.Format24bppRgb))

{

BitmapData bmd = bmp.LockBits(new Rectangle(0, 0, 
Int32.Parse(width), Int32.Parse(height)),

ImageLockMode.WriteOnly, 
PixelFormat.Format24bppRgb);

Marshal.Copy(arr, 0, bmd.Scan0, arr.Length);

bmp.UnlockBits(bmd);

bmp.Save(outputPath + "png", ImageFormat.Png);

}

break;

case "/DCTDecode":

arr = PdfReader.GetStreamBytesRaw((PRStream)obj);

using (MemoryStream ms = new MemoryStream(arr))

{

using (bmp = new Bitmap(ms))

{

bmp.Save(outputPath + "jpeg", 
ImageFormat.Jpeg)

Re: [iText-questions] "Unknown Source" is such a bad thing?

2010-01-27 Thread Mark Storer
I suggest you try that tool commad with a more recent version of iText. 1.4.5 
is a bit long in the tooth.
 

--Mark Storer 
  Senior Software Engineer 
  Cardiff.com

#include  
typedef std::Disclaimer DisCard; 

-Original Message-
From: Cameron Laird [mailto:claird.visipr...@gmail.com]
Sent: Wednesday, January 27, 2010 11:26 AM
To: Post all your questions about iText here
Subject: [iText-questions] "Unknown Source" is such a bad thing?


After considerable effort, we narrowed down a symptom in a much larger system 
to this traceback: 
java.lang.NullPointerException
   at com.lowagie.text.pdf.SimpleBookmark.bookmarkDepth(Unknown Source)
   at com.lowagie.text.pdf.SimpleBookmark.getBookmark(Unknown Source)
   at com.lowagie.tools.concat_pdf.main(Unknown Source)
from, in effect, an invocation of
 java -cp /usr/share/java/itext.jar com.lowagie.tools.concat_pdf L1.pdf 
O1.pdf
This is 1.4.5 of iText.

What are my prospects?  L1.pdf is a 52-page instance that *looks* OK at a 
casual glance. It's probable that L1.pdf is the output from HTMLDOC operations. 
 I suspect I can cut L1.pdf down more to probably just a few crucial pages that 
yield the NullPointerException.  I'm open to advice, though:
A.  Is there any reason to think that someone else is already working on this 
fault?
B.  Is there any way I can pre-process L1.pdf or invoke iText differently so 
that the two get along better?
C.  Is there someone else who'd like to tackle this?  Pay is possible, if that 
makes a difference.

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com___
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] Search in PDF

2010-01-27 Thread Mark Storer
I suspect that the "flowpara" text has been converted to path information 
rather than actual PDF strings.  Can we see the PDF?


--Mark Storer 
  Senior Software Engineer 
  Cardiff.com

#include  
typedef std::Disclaimer DisCard; 



> -Original Message-
> From: EBCTO [mailto:dhubhara...@gmail.com]
> Sent: Wednesday, January 27, 2010 6:07 AM
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] Search in PDF
> 
> 
> 
> HI,
> I am converting SVG to PDF through 
> org.apache.fop.svg.pdftranscoder.
> 
> I am obtaining the PDF output correctly.
> But the search option inside PDF is not working.
> In the PDF I obtained,  the words inside the text tag(while 
> designing SVG)
> are searchable, but not the words inside flowpara tag.
> 
> What may be the reason ?
> -- 
> View this message in context: 
> http://old.nabble.com/Search-in-PDF-tp27339739p27339739.html
> Sent from the iText - General mailing list archive at Nabble.com.
> 
> 
> --
> 
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network 
> in the business
> Choose flexible plans and management services without 
> long-term contracts
> Personal 24x7 support from experience hosting pros just a 
> phone call away.
> http://p.sf.net/sfu/theplanet-com
> ___
> 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/


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
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] "Unknown Source" is such a bad thing?

2010-01-27 Thread Cameron Laird
On Wed, Jan 27, 2010 at 5:22 PM, Mark Storer  wrote:

>  I suggest you try that tool commad with a more recent version of iText.
> 1.4.5 is a bit long in the tooth.
>
>
> ...
>

1.4.5 seems to be the one currently packaged for Ubuntu.  I appreciate your
suggestion that an update might be in order.

I've installed 5.0.0, but it'll be tomorrow before I can recompile
concat_pdf.
--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com___
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/

[iText-questions] Possible bug in function ComputeOwnerKey (PdfEncryption.cs, PdfEncryption.java)

2010-01-27 Thread smilyface

Hi,

I'm a developer from the PDFCreator team. We are using itext and I think I
found a bug in the function ComputeOwnerKey PdfEncryption.cs,
PdfEncryption.java).

I have created some files with Ghostscript and want to open them with itext.
But if I use encrypted pdfs (EncryptionRevision=3; KeyLength=40) itext can't
open these files and throws an exception "bad user password" though I didn't
set a user password. There is no problem if I use (EncryptionRevision=3;
KeyLength=128). Acrobat and other have no problems opening these files.

So I checked the source and I think I found a bug.
The pdf reference 1.6 
(http://partners.adobe.com/public/developer/en/pdf/PDFReference16.pdf) 
said on page 101:
8. (Revision 3 or greater) Do the following 50 times: Take the output from
the previousMD5 hash and pass the first n bytes of the output as input into
a new MD5hash, where n is the number of bytes of the encryption key as
defined by the value of the encryption dictionary’s Length entry.

But in the source you can find these (PdfEncryption.cs):
private byte[] ComputeOwnerKey(byte[] userPad, byte[] ownerPad) {

for (int k = 0; k < 50; ++k)
Array.Copy(DigestComputeHash("MD5", digest), 0, digest, 0, mkey.Length);

First it computes the MD5 and then takes the n bytes and this is not
correct. There is no problem if you use a key length of 128bit. In this case
you use all bytes. But you'll get a problem if the keylength is not 128bit
for example 40bit.
I changed the line:
Array.Copy(DigestComputeHash("MD5", digest), 0, digest, 0, mkey.Length);
to
Array.Copy(DigestComputeHash("MD5", digest, 0, mkey.Length), digest, 16);
.
And now it works for 128bit and 40bit.

Can you check this please.

Best regards,
Frank
Team PDFCreator

PS: If you need sample files just send me an email.
-- 
View this message in context: 
http://old.nabble.com/Possible-bug-in-function-ComputeOwnerKey-%28PdfEncryption.cs%2C-PdfEncryption.java%29-tp27346840p27346840.html
Sent from the iText - General mailing list archive at Nabble.com.


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
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] Form fields via ColumnText and getFieldPositions()

2010-01-27 Thread hansgeerdink

Sorry, that was a leftover from a test I did to find out where the data
went... :confused:


1T3XT info wrote:
> 
> hansgeerdink wrote:
>> ct.setSimpleColumn(position[1],-position[2],position[3],-position[4]);
>> System.out.println(position[1]+"\t"+position[2]+"\t"+position[3]+"\t"+position[4]+"\t"+veld);
> 
> Why are you using a negative value for the y-coordinates?
> -- 
> This answer is provided by 1T3XT BVBA
> http://www.1t3xt.com/ - http://www.1t3xt.info
> 
> --
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the
> business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> ___
> 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/
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Form-fields-via-ColumnText-and-getFieldPositions%28%29-tp27330725p27345329.html
Sent from the iText - General mailing list archive at Nabble.com.


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
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] Merge of detached signature

2010-01-27 Thread java-chris

Hello Andreas, im on the same issue here.

When you talk about " store the half-baked pdf on the disk ".
Im trying to do that by making some serialization on the Stamper but nothing
is serializable in ITEXT.

So , im trying to do this way. 

[CODE]

// write the current file.
byte[] buf = new byte[8192];
java.io.InputStream s = sap.getRangeStream();
   
ByteArrayOutputStream ss = new ByteArrayOutputStream();

int read = 0;
while ((read = s.read(buf, 0, buf.length)) > 0) {
ss.write(buf, 0, read);
}
// write SS to the disk.

FileOutputStream fos = new FileOutputStream("blank.in_process");
ss.writeTo(fos);
fos.close();
ss.close();

[/CODE]

But when im trying to read the stamper again to put the signature on : 

 PdfReader reader = new PdfReader("blank.in_process");
 PdfStamper stamper = new PdfStamper(reader,new
FileOutputStream("signedDoc.pdf"));
 PdfSignatureAppearance sa = stamper.getSignatureAppearance();

The signature PdfSignatureAppearance is null  
I think im missing something here ... 

How you procede to store the half-baked pdf on the disk ? 
Did i procede the right way ? 

Cheer's 

Christian Leclerc



Couldn't remember that I ever disagreed with Leonard, but now it's the time
!

Of course it's possible what your describing :

- Build a semi-signed PDF with room for the signature
- Get the hash value
- Store the half-baked PDF on disk
- Sign the hash and create a PKCS7-Signature, somtimes later, somewhere
- Insert the signature into the spare bytes in the PDF
- Ready

Due to wierd legal requirements we had to take this multi-step approach and
it works !

Greetings
Andreas


-- 
View this message in context: 
http://old.nabble.com/Merge-of-detached-signature-tp27314294p27347402.html
Sent from the iText - General mailing list archive at Nabble.com.


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
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] Form fields via ColumnText and getFieldPositions()

2010-01-27 Thread 1T3XT info
hansgeerdink wrote:
> Sorry, that was a leftover from a test I did to find out where the data
> went... :confused:

Does changing the sign solve the problem?
Or is there still another problem unrelated to the sign?
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
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/