The formats in Acrobat are done with JavaScript and are out of the
understanding of iText. You'll have to make your formating. Note that you
can have a value different from the appearance, see
AcroFields.setField(String,String,String).

Best Regards,
Paulo Soares

----- Original Message ----- 
From: "Merlyn Mathias" <[EMAIL PROTECTED]>
To: "Paulo Soares" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Friday, October 08, 2004 18:14
Subject: RE: [iText-questions] Comb characters


>
> Hi Paulo,
>
> I did not know about the new release until I read your mail today. I
downloaded it, and the comb problem is solved. It looks very good. Thank you
so much.
>
> I have another question. I have a date field in the PDF form to be
displayed in mm/dd/yyyy format. I get the data from the database as
mmddyyyy. Is there anyway I can get the field format from Acrofields?
Something like .........
>
> PdfReader.getPdfObject
>                  (((PdfDictionary)item.values.get(0)).get(PdfName))
>
> so that I can format the value myself before I set it.
>
> Thanks again for your help.
> Merlyn.
>
> Paulo Soares <[EMAIL PROTECTED]> wrote:
> Did the itext-paulo-139 version solved the comb problem?
>
> Best Regards,
> Paulo Soares
>
>
> ---------------------------------
> From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paulo
Soares
> Sent: Tuesday, September 28, 2004 4:53 PM
> To: Merlyn Mathias; [EMAIL PROTECTED]
> Subject: RE: [iText-questions] Comb characters
>
>
>
> I had some hope of having a release this week but I have a lot of new
things to include and next week is the new date. If there's no accident the
text comb will be there.
>
> Best Regards,
> Paulo Soares
>
>
> ---------------------------------
> From: Merlyn Mathias [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 28, 2004 4:37 PM
> To: Paulo Soares; [EMAIL PROTECTED]
> Subject: RE: [iText-questions] Comb characters
>
>
>
> Hi Paulo,
>
> When do you plan on releasing the next build with this feature? If it is
not anytime soon, is there any workaround for this?
>
> Thank you very much
> Merlyn.
>
> Paulo Soares <[EMAIL PROTECTED]> wrote:
> I didn't even knew what a text comb was. It doesn't look too difficult to
implement, I'll have it ready next week.
>
> Best Regards,
> Paulo Soares
>
>
> ---------------------------------
> From: Merlyn Mathias [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 23, 2004 2:55 PM
> To: Paulo Soares; [EMAIL PROTECTED]
> Subject: RE: [iText-questions] Comb characters
>
>
>
>
> Thank you very much for the quick response. Attached are the pdf files.
test.pdf is my original PDF and if I try to enter data directly using
acrobat reader, it looks as expected. withitext.pdf is the one generated
using the following code.
>
> In my servlet:
>
>    OutputStream outStream = response.getOutputStream();
>   response.setContentType("application/pdf");
>
>    byte[] byteArray = createPDF(xmlDocument, url, fileName);
>
>   response.setContentLength(byteArray.length);
>   outStream.write(byteArray);
>   outStream.close();
>
> public byte[] createPdf(XMLDocument xmlDocument, String url, String
fileName)  {
>       ByteArrayOutputStream out   = null;
>       String     pdfFile  = url + fileName;
>       PdfReader    reader   = null;
>       PdfStamper    stamper  = null;
>
>       try
>       {
>           out = new ByteArrayOutputStream();
>           reader = new PdfReader(new URL(pdfFile));
>           stamper = new PdfStamper(reader, out);
>
>           AcroFields form = stamper.getAcroFields();
>
>           populateFormFields(form, xmlDocument);
>
>           stamper.close();
>
>       }
>       catch (DocumentException e)
>       {
>            e.printStackTrace();
>       }
>       catch (IOException e)
>       {
>         e.printStackTrace();
>       }
>
>       return out.toByteArray();
>   }
>
>
>   public void populateFormFields(AcroFields form, XMLDocument xmlDocument)
throws IOException, DocumentException
>   {
>
>       form.setField("Text2", "0123456789AB");
>       lockField(form, "Text2");
>
>
>      }
>
>   public void lockField(AcroFields form, String name)
>   {
>       AcroFields.Item item = form.getFieldItem(name);
>
>       for (int k = 0; k < item.merged.size(); ++k)
>       {
>            PdfNumber num = (PdfNumber)PdfReader.getPdfObject
>                  (((PdfDictionary)item.values.get(k)).get(PdfName.FF));
>            int val = 0;
>
>            if (num != null)
>                val = num.intValue();
>
>            num = new PdfNumber(val | PdfFormField.FF_READ_ONLY);
>
>            ((PdfDictionary)item.merged.get(k)).put(PdfName.FF, num);
>            ((PdfDictionary)item.values.get(k)).put(PdfName.FF, num);
>        }
>   }
>
> Thanks again,
> Merlyn.
>
>
> Paulo Soares <[EMAIL PROTECTED]> wrote:
> I have to see the PDF and the code you use to set the field.
>
> Best Regards,
> Paulo Soares
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On
> > Behalf Of Merlyn Mathias
> > Sent: Wednesday, September 22, 2004 9:08 PM
> > To: [EMAIL PROTECTED]
> > Subject: [iText-questions] Comb characters
> >
> > Hi,
> >
> > I just downloaded itext and started using it. I created a PDF
> > form using adobe
> > acrobat 6.0. This form contains a field with option 'Comb of
> > 12 characters'.
> > (I want to display each character in one box. )It works fine
> > while filling up
> > the form online. I use itext to read this file and set the
> > form fields with
> > the data from the database. The PDF is returned as a
> > ByteArrayOutputStream in
> > the memory and sent back to the browser. The property 'comb'
> > doesnt work. The
> > characters do not show up in separate boxes, instead they
> > appear as one
> > string. Is this a known bug or am I missing something?
> >
> > Thank you so much for your help.
> >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
> > Project Admins to receive an Apple iPod Mini FREE for your
> > judgement on
> > who ports your project to Linux PPC the best. Sponsored by IBM.
> > Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
> > _______________________________________________
> > iText-questions mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/itext-questions
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
> ---------------------------------
> Do you Yahoo!?
> vote.yahoo.com - Register online to vote today!
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Mail Address AutoComplete - You start. We finish.



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to