[iText-questions] iTextSharp 5.0.2

2010-05-10 Thread RivasAviles, Miguel
Hello everyone:

I'm completely new to iTextSharp and I'm trying to convert some html files to 
pdf.  The problem is that almost every single example that I found is 
referencing classes from past iText releases.  I would like to use the new 
release but I simply cannot find documentation and/or examples for this new 
release.  BTW I'm stuck with my simple test:

 CODE 
// Create the document
iTextSharp.text.Document idocument = new 
iTextSharp.text.Document(iTextSharp.text.PageSize.A4);

// Create the output file
iTextSharp.text.pdf.PdfWriter.GetInstance(idocument, new 
FileStream("d:\\watch\\iTextSharpTest.pdf", FileMode.Create));

try
{
// Open the document
idocument.Open();

  // Parse the document
iTextSharp.text.html.simpleparser.HTMLWorker.ParseToList(new 
StreamReader(FileToParse), null);

  // HERE is the problem, I don't know what to do next

}
catch (Exception ex)
{
  // TODO: Deal with the exception
}
finally
{
if (idocument.IsOpen())
idocument.Close();
}
 END CODE 

Thank you for your help.

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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] how to detect remote links in a PDF ?

2010-05-10 Thread Leonard Rosenthol
>> There is no such thing as "canonical" PDF - anything that complies with the 
>> PDF specification is valid. That allows for various uses of >>compression, 
>> ASCII encoding, etc.
>
>Well, not really. If there are rules for the PDF standard then you could in 
>fact create some alternative representation- it could
>be super big, verbose, complicated, etc but it may be a useful intermediate 
>form for various types of work
>such as debug or adhoc editing where you don't want to waste time writing 
>custom code to do something simple. 
>
No argument!   

BUT an "intermediate format" (or an "alternative format") and a "canonical 
format" are VERY VERY different things...

There are many folks who have developed alternative representations of PDF, 
whether in XML or other formats, including Adobe ourselves.  For example, Adobe 
has a project codenamed "Mars" on our Labs site 
() which describes an XML+ZIP-based 
representation of PDF.  It supports all of the features of PDF from PDF 1.7.  
We provide some tooling for Acrobat & Reader, and you are welcome to develop 
your own. 

But again, that's NOT canonical - just alternative.


>> That's why library such as iText exist - to provide you with higher level 
>> APIs (where possible). They are what one would use to create 
>> automated test tools, validators, etc. And many such tools already do exist 
>> - so it's definitely doable (and has been done).
>>
>If you took that attitude you couldn't even hide behind "but pdf is a 
>standard" since then the argument is " well I have API
>xyz and we can do anything with it. if you use my ABC format"  I guess having 
>a list would help, is there a pdf
>developer download somewhere with tools like this? 
>
Adobe Acrobat Professional includes a PDF validator feature as part of its 
Preflight module, and has since version 7.  It is the only publicly available 
validator that I am aware of, though I have spoken to at least a half-dozen 
commercial PDF vendors that have told me that they have developed their own 
validators for their own use.

There used to be two limited open source validators - JHOVE 
() and Multivalent 
().   But to my 
knowledge, neither is currently supported/updated.   Since both were Java-based 
OSS, I would think you could pick them up and run with them if you wished.


Leonard


--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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] how to detect remote links in a PDF ?

2010-05-10 Thread Mike Marchywka













> From: lrose...@adobe.com
> To: itext-questions@lists.sourceforge.net
> Date: Mon, 10 May 2010 18:09:15 -0700
> Subject: Re: [iText-questions] how to detect remote links in a PDF ?
>
> There is no such thing as "canonical" PDF - anything that complies with the 
> PDF specification is valid. That allows for various uses of compression, 
> ASCII encoding, etc.
>
> There are certainly tools out there that will uncompress/defilter all the 
> elements in the PDF so that it is "plain text" and can be searched using 
> text-only tools - though certainly that wouldn't help you for modifications 
> (for obvious reasons).

Well, not really. If there are rules for the PDF standard then you could in 
fact create some alternative representation- it could
be super big, verbose, complicated, etc but it may be a useful intermediate 
form for various types of work
such as debug or adhoc editing where you don't want to waste time writing 
custom code to do something
simple. "XXX Intermediate Form" is a very common file format :) I guess you 
could imagine expanding 
it to some XML format where you have decompressed the text and done something 
with the images, fonts, and formatting
information- no idea what. Essentially your claim is that PDF is so bizarre, 
unique, superlative,  and singular, nothing can possibly
equal it :) I just downloaded some schematic capture programs and those create 
"documents" that are inherently graphical-
schematics- but the essential features can be easily extracted as concise text 
netlists. 

>
> That's why library such as iText exist - to provide you with higher level 
> APIs (where possible). They are what one would use to create automated test 
> tools, validators, etc. And many such tools already do exist - so it's 
> definitely doable (and has been done).

If you took that attitude you couldn't even hide behind "but pdf is a standard" 
since then the argument is " well I have API
xyz and we can do anything with it. if you use my ABC format"  I guess having a 
list would help, is there a pdf
developer download somewhere with tools like this? This reminds me of when I 
first got here and you explained
logical structure was available but everytimei it comes up in a concrete rather 
than hypothetical case
everyone says, "Sure you could preserve strcuture but it is too copmlicated to 
be practical."  In the present
case, you say the tools exist but when someone shows up with an error from 
acrobat no one can point to a
tool to check the pdf. 


>
> And let us not forget the expression - just because you only have a hammer, 
> doesn't mean everything is a nail!

That's fine if you have a list of tools somewhere but I keep seeing the same 
hammer being used, usually
an Acrobate reader with the informative diagnostics "your pdf is damaged." 
Again, I'm not saying this
is a fault with ADBE or pdf, but it would be nice to refer people to some list 
of tools that give a better
diagnostic. In many cases of course all you really care about is the text and 
the hammer gets almost everything
done. When you need the graphics that is a different situation. 

So ok I've only got one swiss army knife LOL.


>
> Leonard
>
> -Original Message-
> From: Mike Marchywka [mailto:marchy...@hotmail.com]
> Sent: Monday, May 10, 2010 6:02 PM
> To: itext-questions@lists.sourceforge.net
> Subject: Re: [iText-questions] how to detect remote links in a PDF ?
>
>
>
>
>
>
>
> 
>> From: lrose...@adobe.com
>> To: itext-questions@lists.sourceforge.net
>> Date: Mon, 10 May 2010 06:44:13 -0700
>> Subject: Re: [iText-questions] how to detect remote links in a PDF ?
>>
>> Prior to PDF 1.5, you could have done a grep (or equivalent) since only 
>> stream objects were compressed. However, as of PDF 1.5, we now have "object 
>> streams", where groups of objects are placed into a stream and then 
>> compressed - which means that grep will no longer work.
>>
>> Adobe Acrobat 9 will ALWAYS (unless restricted by a specific ISO standard, 
>> such as PDF/A) use object stream compression to keep file sizes down. I've 
>> been trying to recommend that other products do the same.
>
>
> Is there some utility like in pdf tk to convert a pdf with arbitrary stuff in 
> it to some "Standard" or
> canonical format that can let it be used with other tools so you don't have 
> to write custom code for
> every little trivail variation of a thing you wish to accopmlish? For example,
>
> cat xxx.pdf | pdf_to_standard_form | grep http
>
>
> Obivously applicability would go beyond the immediate question but also let 
> people writing itext
> code have some way to check their results more easily than "it opened in 
> proprietary adobe product X
> but in black box Y it greyed out 3 menu options and wouldn't let me save it 
> unless blah blah bla ?"
>
> There is nothing wrong with a human readable end product but given the 
> complexity of these things
> i

Re: [iText-questions] how to detect remote links in a PDF ?

2010-05-10 Thread Leonard Rosenthol
There is no such thing as "canonical" PDF - anything that complies with the PDF 
specification is valid.  That allows for various uses of compression, ASCII 
encoding, etc.  

There are certainly tools out there that will uncompress/defilter all the 
elements in the PDF so that it is "plain text" and can be searched using 
text-only tools - though certainly that wouldn't help you for modifications 
(for obvious reasons).   

That's why library such as iText exist - to provide you with higher level APIs 
(where possible).  They are what one would use to create automated test tools, 
validators, etc.   And many such tools already do exist - so it's definitely 
doable (and has been done).

And let us not forget the expression - just because you only have a hammer, 
doesn't mean everything is a nail!

Leonard

-Original Message-
From: Mike Marchywka [mailto:marchy...@hotmail.com] 
Sent: Monday, May 10, 2010 6:02 PM
To: itext-questions@lists.sourceforge.net
Subject: Re: [iText-questions] how to detect remote links in a PDF ?








> From: lrose...@adobe.com
> To: itext-questions@lists.sourceforge.net
> Date: Mon, 10 May 2010 06:44:13 -0700
> Subject: Re: [iText-questions] how to detect remote links in a PDF ?
>
> Prior to PDF 1.5, you could have done a grep (or equivalent) since only 
> stream objects were compressed. However, as of PDF 1.5, we now have "object 
> streams", where groups of objects are placed into a stream and then 
> compressed - which means that grep will no longer work.
>
> Adobe Acrobat 9 will ALWAYS (unless restricted by a specific ISO standard, 
> such as PDF/A) use object stream compression to keep file sizes down. I've 
> been trying to recommend that other products do the same.


Is there some utility like in pdf tk to convert a pdf with arbitrary stuff in 
it to some "Standard" or 
canonical format that can let it be used with other tools so you don't have to 
write custom code for
every little trivail variation of a thing you wish to accopmlish? For example,

cat xxx.pdf | pdf_to_standard_form | grep http 


Obivously applicability would go beyond the immediate question but also let 
people writing itext
code have some way to check their results more easily than "it opened in 
proprietary adobe product X
but in black box Y it greyed out 3 menu options and wouldn't let me save it 
unless blah blah bla ?"

There is nothing wrong with a human readable end product but given the 
complexity of these things
it would be nice to use computers to automate certain things, like checking for 
links
or other attributes. Without ability to use automated tools everything comes 
down to a long
menu chain and terse messages from products not designed for debug.





>
> So while there certainly exists lots of PDFs that you could grep, the numbers 
> are reducing daily...
>
> Leonard
>
> -Original Message-
> From: Mike Marchywka [mailto:marchy...@hotmail.com]
> Sent: Monday, May 10, 2010 3:51 AM
> To: itext-questions@lists.sourceforge.net
> Subject: Re: [iText-questions] how to detect remote links in a PDF ?
>
>
>
>
>
>
>
>
>
>
>
> 
>> Date: Sun, 9 May 2010 23:08:51 +0200
>> From: papa...@googlemail.com
>> To: itext-questions@lists.sourceforge.net
>> Subject: [iText-questions] how to detect remote links in a PDF ?
>>
>> Colleagues,
>>
>> For an application, one needs to detect the hyperlinks (i.e. done with
>> Chunk.setRemoteGoto) in a PDF which point to an other PDF, can someone
>> point me to a solution ?
>
> Question for leonard or others who have read the spec, if you literally ONLY
> want to list the links, not parse the document or determine any context,
>  are they likely to be hidden or can you just use text
> tools to find strings that start or contain "http" ? For example,
>
>
>   540  cat *.pdf ../Desktop/*.pdf  | sed -e 's/[^a-ZA-Z0-9/:.?]/\n/g' | grep 
> http
>   541  cat *.pdf ../Desktop/*.pdf  | strings | grep http
>   542  history
>
> These seem to work in that they find things with http but not sure what would 
> be
> missing. Many of these seem to be surrounded by xml or prefixed with "/A"
> but not sure what other contexts may exist.
>
> Thanks.
>
>
>
>
>
>
>>
>> Thank you very much in advance,
>> Pieter Vankeerberghen
>>
>> --
>>
>> ___
>> iText-questions mailing list
>> iText-questions@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/itext-questions
>>
>> Buy the iText book: http://www.itextpdf.com/book/
>> 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 New Busy think 9 to 5 is a cute idea. Combine multiple calendars with 
> Hotmail.
> http://

Re: [iText-questions] how to detect remote links in a PDF ?

2010-05-10 Thread Mike Marchywka







> From: lrose...@adobe.com
> To: itext-questions@lists.sourceforge.net
> Date: Mon, 10 May 2010 06:44:13 -0700
> Subject: Re: [iText-questions] how to detect remote links in a PDF ?
>
> Prior to PDF 1.5, you could have done a grep (or equivalent) since only 
> stream objects were compressed. However, as of PDF 1.5, we now have "object 
> streams", where groups of objects are placed into a stream and then 
> compressed - which means that grep will no longer work.
>
> Adobe Acrobat 9 will ALWAYS (unless restricted by a specific ISO standard, 
> such as PDF/A) use object stream compression to keep file sizes down. I've 
> been trying to recommend that other products do the same.


Is there some utility like in pdf tk to convert a pdf with arbitrary stuff in 
it to some "Standard" or 
canonical format that can let it be used with other tools so you don't have to 
write custom code for
every little trivail variation of a thing you wish to accopmlish? For example,

cat xxx.pdf | pdf_to_standard_form | grep http 


Obivously applicability would go beyond the immediate question but also let 
people writing itext
code have some way to check their results more easily than "it opened in 
proprietary adobe product X
but in black box Y it greyed out 3 menu options and wouldn't let me save it 
unless blah blah bla ?"

There is nothing wrong with a human readable end product but given the 
complexity of these things
it would be nice to use computers to automate certain things, like checking for 
links
or other attributes. Without ability to use automated tools everything comes 
down to a long
menu chain and terse messages from products not designed for debug.





>
> So while there certainly exists lots of PDFs that you could grep, the numbers 
> are reducing daily...
>
> Leonard
>
> -Original Message-
> From: Mike Marchywka [mailto:marchy...@hotmail.com]
> Sent: Monday, May 10, 2010 3:51 AM
> To: itext-questions@lists.sourceforge.net
> Subject: Re: [iText-questions] how to detect remote links in a PDF ?
>
>
>
>
>
>
>
>
>
>
>
> 
>> Date: Sun, 9 May 2010 23:08:51 +0200
>> From: papa...@googlemail.com
>> To: itext-questions@lists.sourceforge.net
>> Subject: [iText-questions] how to detect remote links in a PDF ?
>>
>> Colleagues,
>>
>> For an application, one needs to detect the hyperlinks (i.e. done with
>> Chunk.setRemoteGoto) in a PDF which point to an other PDF, can someone
>> point me to a solution ?
>
> Question for leonard or others who have read the spec, if you literally ONLY
> want to list the links, not parse the document or determine any context,
>  are they likely to be hidden or can you just use text
> tools to find strings that start or contain "http" ? For example,
>
>
>   540  cat *.pdf ../Desktop/*.pdf  | sed -e 's/[^a-ZA-Z0-9/:.?]/\n/g' | grep 
> http
>   541  cat *.pdf ../Desktop/*.pdf  | strings | grep http
>   542  history
>
> These seem to work in that they find things with http but not sure what would 
> be
> missing. Many of these seem to be surrounded by xml or prefixed with "/A"
> but not sure what other contexts may exist.
>
> Thanks.
>
>
>
>
>
>
>>
>> Thank you very much in advance,
>> Pieter Vankeerberghen
>>
>> --
>>
>> ___
>> iText-questions mailing list
>> iText-questions@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/itext-questions
>>
>> Buy the iText book: http://www.itextpdf.com/book/
>> 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 New Busy think 9 to 5 is a cute idea. Combine multiple calendars with 
> Hotmail.
> http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
> --
>
> ___
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.itextpdf.com/book/
> 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 mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.itextpdf.com/book/
> Check the site with examples before you ask questions: 
> http://www.1t3xt.info/examples/
> You can also search the keywords

Re: [iText-questions] animation: best approach

2010-05-10 Thread Leonard Rosenthol
Embedding SWF is what you want to do.

-Original Message-
From: Michael Brewer-Davis [mailto:mich...@tech4learning.com] 
Sent: Monday, May 10, 2010 5:49 PM
To: itext-questions@lists.sourceforge.net
Subject: [iText-questions] animation: best approach

What are y'all's thoughts on the best way to approach animations in PDF? 
  Thoughts expressed on this list, plus other theoretical possibilities:

- timed action cycling of images
- embedding SWF or video
- JavaScript
- 3D animation

Which have people had success with, and for what types of application? 
(My current use case is kind of Powerpoint-y object animations (fly 
in/out of individual elements) and animated GIF, but I'm interested to 
know what other people have looked into.)

Best,
michael


--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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 mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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] animation: best approach

2010-05-10 Thread Michael Brewer-Davis
What are y'all's thoughts on the best way to approach animations in PDF? 
  Thoughts expressed on this list, plus other theoretical possibilities:

- timed action cycling of images
- embedding SWF or video
- JavaScript
- 3D animation

Which have people had success with, and for what types of application? 
(My current use case is kind of Powerpoint-y object animations (fly 
in/out of individual elements) and animated GIF, but I'm interested to 
know what other people have looked into.)

Best,
michael


--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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] .NET/iTextSharp Apply Digital Signature

2010-05-10 Thread chorpeac

I've seen the  http://itextpdf.sourceforge.net/howtosign.html How to sign 
section and we have a solution working for a windows application. Now we
want to have this work on an ASP.NET project. Users log in with a smart
card, and our initial impression was that we could user the
ClientCertificate available in the HTTP Request object as the signing cert,
but that doesn't turn out to work. Do we need to use a java applet or
ActiveX object to interface with the card? Any help or assistance would be
greatly appreciated.
-- 
View this message in context: 
http://itext-general.2136553.n4.nabble.com/NET-iTextSharp-Apply-Digital-Signature-tp2172831p2172831.html
Sent from the iText - General mailing list archive at Nabble.com.

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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] Remove pdf attachments

2010-05-10 Thread r00fus

Hi,
I'm new to this list but have a question which I don't think has been
resolved here in my searches through the archives.

I'm trying to remove attachments from a number of my pdf files (I can
extract via pdftk, so preserving them is not an issue).

I found the following example code on the mailing list from a 
http://old.nabble.com/Remove-Attachments-from-pdf-file-td22804697.html
previous thread :
public void removeAttachments(PdfReader reader) {   
PdfDictionary catalog = reader.getCatalog(); 
PdfDictionary names =
(PdfDictionary)PdfReader.getPdfObject(catalog.get(PdfName.NAMES));   
if( names != null)   { 
 PdfDictionary files = (PdfDictionary)
PdfReader.getPdfObject(names.get(PdfName.EMBEDDEDFILES));   
if( files!= null ){   
for( Object key : files.getKeys() ){ 
  files.remove((PdfName)key); 
} 
 reader.removeUnusedObjects(); 
 }   
} 
} 
However, the code does not work.In my introspection of the code, I only
found that the variable "names" is null.  On further examination, even
"catalog.get(PdfName.NAMES)" shows null on a System.out.println().

Before I spend days diving deep into the itext library and PDF spec, I was
wondering if someone could help me in figuring out what I can do to get this
working.

Thanks in advance!


-- 
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Remove-pdf-attachments-tp2172927p2172927.html
Sent from the iText - General mailing list archive at Nabble.com.

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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] What action is requred in terms of License

2010-05-10 Thread Sebastian Sickelmann
We also thought about making a fork for bug-fixing and improvements for 
concurrent-algorithms. Please write me if you want to start a fork.

Kind regards
Sebastian 


 Original-Nachricht 
> Datum: Fri, 7 May 2010 14:19:41 +0200
> Von: TvT 
> An: Post all your questions about iText here 
> 
> Betreff: Re: [iText-questions] What action is requred in terms of License

> Just read the whole thread and it sounded like the internal discussion we
> had in our company as well.
> We are willing to pay for such a great lib, however not 10K-12,5K which
> would basically eat up the budget. Of course one can argue that the
> project
> calculation/budget is wrong but reality is more complicated than that...
> 
> So currently we are using 2.1.7 and we are fine, even thought of making a
> fork to that version...
> The idea of a 'per developer license' sounds interesting to me...
> 
> Good discussion,
> ToM
> 
> 2010/4/25 Michael Schmodt 
> 
> >
> >
> > 2010/4/25 David Hoffer 
> >
> > I don't disagree with the last couple replies, however I will point
> >> out that iText is the one that caused the mis-expectations on price.
> >> Since prior versions cost $0 it is quite a shock to learn that new
> >> versions cost $12,500.  (Please understand I'm not saying $0 is the
> >> right price.)  What makes it even harder is that there are no
> >> published prices for the new version of iText.
> >>
> >> Unless your doing waterfall development (so you think you know
> >> everything up front) you don't always know what's needed at the
> >> beginning.  If I would go to my customer with a Y charge of $12,500
> >> that would be the end of it.
> >>
> >> I'm only saying all this because I was asked to explain, in my case
> >> the older 2.x version is just fine and FOP a viable option if iText
> >> continues with the current pricing.
> >>
> >>
> > I agree with Dave! I think, it is fair to pay the iText developers for
> > their fantastic work. I do not have a problem with that.
> >
> > The problem: For my customers, it is completely irrelevant, what
> > investments I have to do, to build an application. They give me 5000
> bucks
> > in total to deliver a programm. If there are license fees, it's me who
> has
> > to deal with it. If I do not comply, somebody else get's the job. The
> > applications aren't targeted at the mass market, so there aren't huge
> > numbers of copies of the programms. When calculating the price, it's
> about
> > 7% or 12 $ per programm that I earn (minus costs, taxes ...). I do not
> have
> > exact numbers, but that should be quite representative.
> >
> > I surely can agree, that the customer and not the developer should care
> > about the license, but unfortunately, that is not the way life is. The
> > customers are from non IT businesses who want additions/extension to
> > existing non IT products. They never heard of LGPL, GPL, AGPL or license
> > fees for software libraries. I agree with Dave, that 300 $ would be
> > perfectly fine and after all, 300$ from single developers is for you as
> well
> > a question of getting 300$ or getting no fees and letting developer
> stick
> > with earlier versions of itext or using other libraries.
> >
> > I hope, I didn't upset you. This is not what I want. As I said, I like
> > iText very much and would like to use it in the future. I respect your
> > decission to change the license and to get a share from the profits of
> > those, who use your lib. Try to see this debate as a valuable feedback
> to
> > determine optimal  prices for the lib, that can maximize your income as
> > well.
> >
> > By,
> >   Michael
> >

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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] Problems with ConcatCTM

2010-05-10 Thread Dean Krueger
Hi,
 I have a PDF that I am changing the art,trim,crop and media boxes,
using PdfContentByte.ConcatCTM
and writing to a PdfStamper object. This has always worked, until I came
across this one PDF file. It seems that when I set the offset of the page
all but one logo is moving. You can see the offset in the screen shot
supplied. This is a single page PDF, can anyone think of what could possibly
causing this. I have never seen this happen to any pdf before, normally when
its offset the entire pdf moves as expected. I can furnish the PDF if anyone
would like to see it, its 19meg.

This is the main guts to the code:
byte[] b = Reader.GetPageContent(page);
PdfContentByte cb = new PdfContentByte(null);
cb.ConcatCTM(1, 0, 0, 1, -5f, -5f);


Thank you for any idea's!
Dean
<>--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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] Updating internal links in a contatenated pdf

2010-05-10 Thread 1T3XT info
Maicas Juanes, Miguel Ángel wrote:
> Hi,
> 
> I have 2 pdf documents (doc1.pdf ; doc2.pdf) that I must concatenate in 
> another pdf (result.pdf)

OK

> doc1.pdf and doc2.pdf have internal links

OK

> I'm using a variant of the code of ConcatenateStamp sample:
> http://itextpdf.com/examples/index.php?page=example&id=128

That's an example from the second edition of the book "iText in Action". 
It is assumed that you have purchased the book if you use this example.

> The result document (result.pdf) is created but internal links of the 
> second document (doc2.pdf) have the original page destination (if the 
> first link in doc2.pdf point to the 3th page of doc2.pdf the same link 
> in result.pdf point to the 3th page of result.pdf).

The answer can be found in part 2 of the book, please read on, and 
you'll find it.

> I've tried to change the destination using this code:

The answer to your question is mentioned literally in the book.
The chapter you need is already available: http://itextpdf.com/book/
(Note that you shouldn't buy the book through Amazon if you need an 
immediate answer.)
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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] Updating internal links in a contatenated pdf

2010-05-10 Thread Maicas Juanes, Miguel Ángel
Hi,

 

I have 2 pdf documents (doc1.pdf ; doc2.pdf) that I must concatenate in another 
pdf (result.pdf)

 

doc1.pdf and doc2.pdf have internal links

 

I'm using a variant of the code of ConcatenateStamp sample:

http://itextpdf.com/examples/index.php?page=example&id=128

 

The result document (result.pdf) is created but internal links of the second 
document (doc2.pdf) have the original page destination (if the first link in 
doc2.pdf point to the 3th page of doc2.pdf the same link in result.pdf point to 
the 3th page of result.pdf).

 

I've tried to change the destination using this code:

 

public class ConcatenateStamp2 {

 

 

/**

 * Main method.

 * @param args no arguments needed

 * @throws DocumentException

 * @throws IOException

 * @throws SQLException

 */

public static void main(String[] args)

throws IOException, DocumentException, SQLException {

 

int numPaginas=0;

int numPaginasInsertadas=0;

 

// step 1

Document document = new Document();

 

// step 2

PdfCopy copy = new PdfCopy(document, new 
FileOutputStream("result.pdf"));

 

// step 3

document.open();

 

numPaginasInsertadas=insertarPaginas("doc1.pdf",

copy,

numPaginas);

numPaginas+=numPaginasInsertadas;

 

numPaginasInsertadas=insertarPaginas("doc2.pdf",


  copy,


  numPaginas);

 

// step 5

document.close();

}

 

public static int insertPage(String sourceDoc,

PdfCopy copy,

int numPages)

   throws IOException, DocumentException, SQLException {

 

// reader for document 1

PdfReader reader1 = new PdfReader(sourceDoc);

//reader1.consolidateNamedDestinations();

int n1 = reader1.getNumberOfPages();

 

// initializations

PdfImportedPage page;

PdfCopy.PageStamp stamp;

 

// Loop over the pages of document 1

for (int i = 0; i < n1; ) {

 

PdfDictionary pageDic=reader1.getPageN(i);

 

if (pageDic!=null){

// obtener las anotaciones

PdfArray 
anotaciones=pageDic.getAsArray(PdfName.ANNOTS);

 

// recorrer las anotaciones

if (anotaciones!=null){

   for (int 
an=0;an--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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] Signed PDFs get corrupted when copyed from server

2010-05-10 Thread Lucas Matis
Problem Solved!

The issue was really about the RDP Protocol (Remote Desktop). There is
a known bug documented in http://support.microsoft.com/kb/972828.

Here's a description of the RDP Problem:

Files that are copied from a Windows Server 2008-based remote computer to a
Windows XP SP3-based client computer by using the Remote Desktop Connection
6.1 client are corrupted
Consider the following scenario. You have a remote computer that is running
Windows Server 2008 and a client computer that is running Windows XP Service
Pack 3. You use the Remote Desktop Connection 6.1 client to copy a file from
the remote computer to the client computer. After the copy operation is
complete, the size of the copied file is different to the size of the
original file on the remote computer. Additionally, the copied file may be
corrupted.

Maybe it can help others!


Ps. about your question, i use .toArray().

Thanks.



2010/5/10 Paulo Soares 

>  Look like a problem with your transfer service. If I delete the extra
> bytes from the corrupt pdf it works correcly. Are you using
> MemoryStream.GetBuffer() instead of MemoryStream.ToArray()? (just guessing)
>
> Paulo
>
> - Original Message -
> *From:* Lucas Matis 
> *To:* itext-questions@lists.sourceforge.net
> *Sent:* Monday, May 10, 2010 12:02 AM
> *Subject:* [iText-questions] Signed PDFs get corrupted when copyed from
> server
>
> hello,
>
> I'm new in the list but we've been using iTextSharp for a while. I
> developed a windows service that batch sign with Timestamp lots of PDFs (hot
> folder like).
> Since last week, all OK. Now I'm experiencing problems runing the service
> in Windows 2008 x64.
>
> Here is the process:
> 1 - User can opt to add an image to the footer and determine where to put
> the Signature Appearance.
> 2 - when the PDF is copyed to Input Folder, an Event (FileSystemWatcher)
> put that file at Queue.
> 3 - One available thread of the service open that PDF, insert the Image and
> SAP
> 4 - the service then sign and put the timestamp at the signature.
> 5 - the service saves that new PDF signed at output folder.
>
> The Problem:
> We are using windows 2008 x64 to get higher performance. The service runs
> OK on this system.
> This week we realized that once we copy  signed pdfs to any desktop (via
> ciffs or RDP) it get corrupted and the signature is marked as invalid.
>
> More info:
> Searching the web and debuging everything we noted this
> 1 - When i sign at desktop and copy to server, the file opens at the
> server. If i copy that file back to desktop, it get corrupted.
> 2 - When i sign at server, it opens ok at server. If i copy to desktop it
> get corrupted.
> 3 - Looking inside de corrupted PDF we can see bytes after the original
> %%EOF. It seems to be some parts of the original file replicated at the
> end...
> 4 - One file signed with the same routine don't get corrupted at transfer.
> I could not realise why...
>
> Follows links to example PDF:
> The pdf signed - http://www.imprensaoficial.com.br/itext/signed.pdf
> The PDF corrupted after transfer -
> http://www.imprensaoficial.com.br/itext/corrupted.pdf
> The original one - http://www.imprensaoficial.com.br/itext/original.pdf
>
> It would be great if someone can give a hit about the cause, i don't know
> where to look anymore.
>
> thanks a lot.
>
> --
> Lucas Matis
> ---
> "O segredo da genialidade é carregar o espírito da infância na maturidade."
>
>
>
> --
>
>
> ___
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.itextpdf.com/book/
> 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/
>



-- 
Lucas Matis
---
"O segredo da genialidade é carregar o espírito da infância na maturidade."
--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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] Where can I find the character maps for the embedded fonts (Helvetica...)?

2010-05-10 Thread Klas Lindbäck
Have you tried Unicode 2022 (bullet) and 2013 or 2014 (dash)?

/Klas

Fred Janon skrev 20:59:
> I need to insert a big black bullet and a fat horizontal dash in the
> middle of some text in Helvetica 10pt to put a legend next to
> ajFreeChart chart. I need the Unicode for these 2 characters and
> cannot find them. Since Helvetica is embedded, I can't use the Windows
> Character Map tool, I did a search with an online character map and
> cannot find any. I don't want to have to use another font, that would
> make my files bigger for only 2 characters used!
>
> Any hint or tip would be appreciated.
>
> Thanks
>
> Fred
>
>
>



--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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] how to detect remote links in a PDF ?

2010-05-10 Thread Leonard Rosenthol
Prior to PDF 1.5, you could have done a grep (or equivalent) since only stream 
objects were compressed.  However, as of PDF 1.5, we now have "object streams", 
where groups of objects are placed into a stream and then compressed - which 
means that grep will no longer work.

Adobe Acrobat 9 will ALWAYS (unless restricted by a specific ISO standard, such 
as PDF/A) use object stream compression to keep file sizes down.  I've been 
trying to recommend that other products do the same.

So while there certainly exists lots of PDFs that you could grep, the numbers 
are reducing daily...

Leonard

-Original Message-
From: Mike Marchywka [mailto:marchy...@hotmail.com] 
Sent: Monday, May 10, 2010 3:51 AM
To: itext-questions@lists.sourceforge.net
Subject: Re: [iText-questions] how to detect remote links in a PDF ?












> Date: Sun, 9 May 2010 23:08:51 +0200
> From: papa...@googlemail.com
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] how to detect remote links in a PDF ?
>
> Colleagues,
>
> For an application, one needs to detect the hyperlinks (i.e. done with
> Chunk.setRemoteGoto) in a PDF which point to an other PDF, can someone
> point me to a solution ?

Question for leonard or others who have read the spec, if you literally ONLY
want to list the links, not parse the document or determine any context,
 are they likely to be hidden or can you just use text
tools to find strings that start or contain "http" ? For example,


  540  cat *.pdf ../Desktop/*.pdf  | sed -e 's/[^a-ZA-Z0-9/:.?]/\n/g' | grep 
http
  541  cat *.pdf ../Desktop/*.pdf  | strings | grep http
  542  history

These seem to work in that they find things with http but not sure what would be
missing. Many of these seem to be surrounded by xml or prefixed with "/A" 
but not sure what other contexts may exist.

Thanks.






>
> Thank you very much in advance,
> Pieter Vankeerberghen
>
> --
>
> ___
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.itextpdf.com/book/
> 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 New Busy think 9 to 5 is a cute idea. Combine multiple calendars with 
Hotmail. 
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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 mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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] how to detect remote links in a PDF ?

2010-05-10 Thread Mike Marchywka











> Date: Sun, 9 May 2010 23:08:51 +0200
> From: papa...@googlemail.com
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] how to detect remote links in a PDF ?
>
> Colleagues,
>
> For an application, one needs to detect the hyperlinks (i.e. done with
> Chunk.setRemoteGoto) in a PDF which point to an other PDF, can someone
> point me to a solution ?

Question for leonard or others who have read the spec, if you literally ONLY
want to list the links, not parse the document or determine any context,
 are they likely to be hidden or can you just use text
tools to find strings that start or contain "http" ? For example,


  540  cat *.pdf ../Desktop/*.pdf  | sed -e 's/[^a-ZA-Z0-9/:.?]/\n/g' | grep 
http
  541  cat *.pdf ../Desktop/*.pdf  | strings | grep http
  542  history

These seem to work in that they find things with http but not sure what would be
missing. Many of these seem to be surrounded by xml or prefixed with "/A" 
but not sure what other contexts may exist.

Thanks.






>
> Thank you very much in advance,
> Pieter Vankeerberghen
>
> --
>
> ___
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.itextpdf.com/book/
> 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 New Busy think 9 to 5 is a cute idea. Combine multiple calendars with 
Hotmail. 
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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] Alignment / Scaling problem when merging XFA data

2010-05-10 Thread Adam Carless
 > > However, when I fill the fields using
 > > PdfStamper.getAcroFields().mergeXfaData(Document) the values appear to be
 > > dropped slightly, so they appear approximately 1.5mm low on the page. Also
 > > the whole page alignment seems to be altered slightly, with the top and
 > > bottom margins becoming wider.

 > Sounds like you have a form with an XFA form that has an AcroForm
 > counter-part. In that case, iText ignores the XFA and fill out the
 > AcroForm fields which have a slightly different alignment, scaling, etc.

Ahh, thanks for that, I didn't realise XFA and AcroForm/FDF forms could 
co-exist. If I understand correctly, mergeXfaData() will ignore XFA form 
elements if there are FDF form elements, and fill in those instead, is that 
right?

 > Throw away the XFA part using stamper.getAcroFields().removeXfa();
 > after you've merged the XFA data and you'll see that the AcroFields
 > are different than the (removed) XFA fields.

I've tried throwing away the XFA part after calling mergeXfaData(), and yes the 
final PDF does have the fields filled in, and mis-aligned. So it looks like we 
know what the problem is now.

I'm not sure what the solution is though, it looks like there isn't a way to 
tell mergeXfaData() to ignore the AcroForm and fill in the XFA.

Is the only answer to try getting Acrobat Pro to create the initial PDF without 
the AcroForm part, so that iText will not find any FDF form elements, and so 
will merge into the XFA form elements?

Or is there some way to get iText to either remove, or ignore the AcroForm part 
and fill in the XFA part instead?

Thanks again for your help, it's much appreciated.

Adam Carless

The contents of this message and any attachments are confidential and are
intended for the use of the persons to whom it is addressed.
If you are not the intended recipient, you should not copy, forward, use or
alter the message in any way, nor disclose its contents to any other person.
Please notify the sender immediately and delete the e-mail from your system,
if you so wish you can contact us on +44 1624 688000. The sender is not
responsible for any alterations that may have occurred without authorisation.
Any files attached to this email will have been checked by us with virus
detection software before transmission. You should carry out your own virus
checks before opening any attachments, as we do not accept any liability for
loss or damage which may be caused by viruses.

For information regarding company registration please visit the contact page at 
www.hansard.com

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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] Where can I find the character maps for the embedded fonts (Helvetica...)?

2010-05-10 Thread Fred Janon
I need to insert a big black bullet and a fat horizontal dash in the
middle of some text in Helvetica 10pt to put a legend next to
ajFreeChart chart. I need the Unicode for these 2 characters and
cannot find them. Since Helvetica is embedded, I can't use the Windows
Character Map tool, I did a search with an online character map and
cannot find any. I don't want to have to use another font, that would
make my files bigger for only 2 characters used!

Any hint or tip would be appreciated.

Thanks

Fred

--

___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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/