Re: [iText-questions] Inserting images dynamically ...

2002-05-01 Thread Wilhelm *Rafial* Fitzpatrick

At 5:24 PM -0700 5/1/02, Ramakrishna Kuppa wrote:
>I am creating a PDF report dynamically. I have some images which 
>need to be inserted into the document. I am trying to use the Gif 
>class to load the image; however, it needs a URL to the image. How 
>can I specify this during development and distributed deployment?
>
>Having gone thru' the HELP docs. and the API, I felt that the Image 
>API should be expanded to take in the document root and a relative 
>path and return a suitable instance.

There are already many useful ways to obtain and compose URLs in the 
core Java API.  For example, if you are getting your image from a 
file, you can construct a File object representing your base path, 
and then use the File(File, String) constructor to obtain various 
relative paths off that.  File has a handy toURL() method that will 
get you the URL you need.  Similarly, you can construct a base URL 
class and then construct relative paths from it.  Finally, consider 
the Class.getResource(String) method (which returns an URL) as a 
great way to locate image files in a portable manner that will not 
need to change regardless of whether your image in an a file system, 
packed into a JAR file, or even being fetched across the network. 
Consult the core API Javadoc for more information.

-- 
__
 Wilhelm Fitzpatrick  |  When we speak of free
  http://www.3roses.com/  |  software we are referring
 [EMAIL PROTECTED]  |  to freedom not price.

___

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



Re: [iText-questions] How to specify link with japanese chars.

2002-05-01 Thread Kumata Mitsugu

Hello all,

I'm a Japanese iText user.
I will be glad if the follwings are a clue as to the solution of the problem
of Japanese chars.

I do not know if iText will produce PdfString object represented by
hexadecimal strings which must be enclosed within angle brackets < and >.
So, I tried to make a change to a line in a pdf source which is generated by
iText.
Changed result is as follows:

  /F <8341 2f 8343 2e 70 64 66>

Spaces in angle brackets are meaningless for PDF Viewer. I put them just for
making it easy to visually recognize each characters. So, even if there are
no spaces, you can get the same result.

Codes in angle brackets are Shift-JIS code which is a major encoding for
Japanese characters.

"<8341 2f 8343 2e 70 64 66>" represents a relative path.

Each Shift-JIS code represents as follows;
 
 8341 -> Japanese Katakana "a" (30a2 in Unicode)
 2f ---> slash (represents directory)
 8343 -> Japanese Katakana "i" (30a4 in Unicode)
 2e ---> period
 70 ---> p
 64 ---> d
 66 ---> f

This link will work both on Japanese Winodews and Japanese Mac OS with
Japanese Acrobat.

Regards,
KuMi


> The problem here is how are these multi-byte interpreted. What is the
> encoding? I tried to create a link to a directory with a chinese name in my
> computer with Acrobat 4 and it just put a "?" for the chinese name. Maybe it
> works with the japanese Acrobat, or maybe not.
> 
> Best Regards,
> Paulo Soares
> 
>> -Original Message-
>> From:Leonard Rosenthol [SMTP:[EMAIL PROTECTED]]
>> Sent:Tuesday, April 30, 2002 14:17
>> To:Paulo Soares; 'B J'; [EMAIL PROTECTED]
>> Subject:RE: [iText-questions] How to specify link with japanese
>> chars.
>> 
>> At 10:49 AM +0100 4/30/02, Paulo Soares wrote:
>>> According to the PDF specs:
>>> 
>>> The URL must adhere to the character-encoding requirements specified in
>>> RFC 1738. Because 7-bit U.S. ASCII is a strict subset of PDFDocEncoding,
>>> this
>>> value may also be considered to be in that encoding.
>>> 
>> 
>> I agree with that, concerning URL's - that wasn't my point.
>> 
>> I was talking about filenames - which CAN contain multi-byte
>> characters.  In fact the PDF spec (v1.3, section 3.10.1) contains an
>> entire subsection about "Multiple-Byte strings in file specification".
>> 
>> 
>> Leonard
>> -- 
>> --
>> -
>> Leonard Rosenthol
>> 
>> Chief Technical Officer  
>> PDF Sages, Inc.  215-629-3700 (voice)
> 
> ___
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 


___

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



[iText-questions] (no subject)

2002-05-01 Thread Ramakrishna Kuppa





I am receiving this error message when trying to dynamically create and display a PDF document:


"com.lowagie.text.DocumentException: banner-3part1.gif is not a supported GIF-file (the image separator '0x2c' is not found after reading the color table)

    at com.lowagie.text.pdf.PdfDocument.add(Unknown Source)
    at com.lowagie.text.Document.add(Unknown Source)"


I would like to know of any tool / package using which I can check, and modify if necessary, my images.


Thanks





[iText-questions] iText design question

2002-05-01 Thread Leonard Rosenthol

I have two questions about the low level design decisions make during 
the coding of iText.

1) Why the are two different types of low level PDF objects? 
PRObject vs. PDFObject, etc.

2) Why are both these sets of objects private to their package, 
thereby disallowing "low level" access to applications?


I ask these as I am in the process of extending the reading, parsing 
and manipulating capabilities of the library - but these particular 
restrictions are a major roadblock, since it prevents object-level 
access to the application.

And if there isn't any good reason - would one of the maintainers be 
willing to commit the changes to make these objects public?


Thanks in advance,
Leonard
-- 
---
Leonard Rosenthol
Chief Technical Officer  
PDF Sages, Inc.  215-629-3700 (voice)


___

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



[iText-questions] Inserting images dynamically ...

2002-05-01 Thread Ramakrishna Kuppa
Title: Inserting images dynamically ...





Hi


I am creating a PDF report dynamically. I have some images which need to be inserted into the document. I am trying to use the Gif class to load the image; however, it needs a URL to the image. How can I specify this during development and distributed deployment?

Having gone thru' the HELP docs. and the API, I felt that the Image API should be expanded to take in the document root and a relative path and return a suitable instance.

Thanks





[iText-questions] Acrobat 5 vs. Acrobat 4 problem

2002-05-01 Thread Wilhelm *Rafial* Fitzpatrick

I am using iText to create PDF's of filled out forms by opening a 
single page PDF document, copying the page into a new document, and 
adding text to fill out the form fields.  Sometimes the resulting PDF 
has multiple pages, each made by copying the single page template 
over and over again, then adding text.

So far this has worked great.  However, I have discovered that with 
some (not all) of the PDFs I am using a templates, the follow problem 
occurs:

When the output document is viewed in Acrobat Reader 5, the added 
text on the last page is not displayed.  If the document is a single 
page, none of the added text is displayed.  The same documents work 
fine when displayed in Acrobat Reader 4 or xpdf.

Has anyone ever seen a problem like this?  Any suggestions as to what 
might be causing it?

Thanks for any insight!

-wilhelm

-- 
__
 Wilhelm Fitzpatrick  |  When we speak of free
  http://www.3roses.com/  |  software we are referring
 [EMAIL PROTECTED]  |  to freedom not price.

___

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
___
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



Re: [iText-questions] hiding a form field by default

2002-05-01 Thread Paulo Soares

If I understand your question you want the initial state of the field to be
hidden. Use the flag PdfAnnotation.FLAGS_HIDDEN.

Best Regards,
Paulo Soares

- Original Message -
From: "David Teran" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 30, 2002 19:04
Subject: [iText-questions] hiding a form field by default


> Hi,
>
> just wondering how one could hide a form field by default. It should be
> a textfield which gets enabled by another trigger.
>
> kind regards david
>
> p.s. the form support is great!
>
>
> ___
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions





Re: [iText-questions] HELP!! PDF/PS printing experts needed!! -- Problem Solved

2002-05-01 Thread Paulo Soares

It looks like postscript doesn't like empty text objects. Next version will
have this fixed.

Best Regards,
Paulo Soares

- Original Message -
From: "Jared Ellson" <[EMAIL PROTECTED]>
To: "Paulo Soares" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, April 30, 2002 23:55
Subject: Re: [iText-questions] HELP!! PDF/PS printing experts needed!! --
Problem Solved


> Problem solved...
>
> I needed to add...
>
> document.add(new Paragraph(" "));
>
> before document.newPage()
>
> ... now when printed from Adobe 4.0 Unix versions it has no problems.
>
> Just FYI!!
>
> Thanks again for all your help
> Jared
>
>
>
> Paulo Soares wrote:
>
> > I created this PDF with the files you sent me and it prints in a jet
> > printer, epson laser printer and postscript level 3 printer. I used
Acrobat
> > Reader 5.0.
> >
> > Best Regards,
> > Paulo Soares
> >
> >  <>  <>
> >
> > > -Original Message-
> > > From: Jared Ellson [SMTP:[EMAIL PROTECTED]]
> > > Sent: Friday, April 26, 2002 15:36
> > > To:   Paulo Soares
> > > Cc:   [EMAIL PROTECTED]
> > > Subject:  Re: [iText-questions] HELP!!  PDF/PS printing experts
> > > needed!!
> > >
> > > Sorry, I forgot the watermark
> > >
> > > Also, it doesn't matter if it CCITT or not, as long as it prints
> > >
> > > Thanks!
> > > Jared
> > >
> > > Paulo Soares wrote:
> > >
> > > > I can't open itext.pdf in Acrobat 5.0 although I can do it in 4.0.
The
> > > jpg
> > > > image in both is not the same. Send me all the files required to
build
> > > the
> > > > pdf (and the code). By the way, if you use a CCITT image or
transparency
> > > you
> > > > need postscript level 3 to print it.
> > > >
> > > > Best Regards,
> > > > Paulo Soares
> > > >
> > > > > -Original Message-
> > > > > From: Jared Ellson [SMTP:[EMAIL PROTECTED]]
> > > > > Sent: Thursday, April 25, 2002 17:54
> > > > > To:   [EMAIL PROTECTED]
> > > > > Subject:  [iText-questions] HELP!!  PDF/PS printing experts
> > > needed!!
> > > > >
> > > > >  Hi All,
> > > > >
> > > > > I have been working on a printing issue for a while.  I currently
use
> > > > > iText to convert scanned .tiff documents to PDFs for a large
paperless
> > > > > application here at Sun.  The problem that I have encountered is
that
> > > > > the PDF that iText created from tiffs are not printable, I get a
> > > > > typecheck-restore error.  I have tried from many versions of
Acrobat,
> > > > > and even tried with Ghostscript.  If I use Ghostscript to convert
the
> > > > > PDF's to PS the postscript will not print however, if I use
> > > ghostscript
> > > > > to "convert" a pdf to a pdf using the following command:
> > > > >
> > > > >
gs -q -dNOPAUSE -dBATCH  -sDEVICE=pdfwrite -sOutputFile=./itext-gs.pdf
> > > > > ./itext.pdf
> > > > >
> > > > > the PDF becomes printable from Acroread or Ghostscript.  I have
looked
> > > > > at the contents of the two PDFs and don't see any significant
> > > > > differences.  The encoding is the same..
> > > > >
> > > > > I have attached example PDFs, one that doesn't print - itext.pdf
> > > > > (created from iText) and the same PDF after the ghostscript
command
> > > has
> > > > > been run on it and it is printable - itext-gs.pdf.  If someone can
> > > take
> > > > > a look at these and give me an idea where to start or if it is a
> > > > > limitation of iText, please let me know as I have about 9000
documents
> > > a
> > > > > day that go through this process and need to fix it soon before I
have
> > > > > to run the gs command on hundreds of thousands of PDFs.
> > > > >
> > > > > Thank you!!
> > > > > Jared
> > > > >
> > > > > Also, here is the code that converts the tiffs to PDFs:
> > > > >
> > > > > public boolean tiffToPdf(String theTiffFile, String theOutFile)
> > > > > {
> > > > >  Document document = null;
> > > > >
> > > > > try {
> > > > > // creation of the different writers
> > > > >
> > > > > File file = new File(theTiffFile);
> > > > > SeekableStream s = new FileSeekableStream(file);
> > > > > TIFFDirectory dir = new TIFFDirectory(s, 0);
> > > > > long IFDOffset = dir.getIFDOffset();
> > > > >  Watermark watermark = null;
> > > > > PdfWriter writer = null;
> > > > > PdfContentByte cb = null;
> > > > >
> > > > >
> > > > > while (IFDOffset != 0L) {
> > > > > dir = new TIFFDirectory(s, IFDOffset, 0);
> > > > > IFDOffset = dir.getNextIFDOffset();
> > > > > long h =
> > > > > dir.getFieldAsLong(TIFFImageDecoder.TIFF_IMAGE_LENGTH);
> > > > > long w =
> > > > > dir.getFieldAsLong(TIFFImageDecoder.TIFF_IMAGE_WIDTH);
> > > > >
> > > > > if (document == null)
> > > > > {
> > > > > if((int)w > 1800)
> > > > > {
> > > > > watermark = new
> > > > >
Watermark(Image.getInstance(ConverterProperties.WA