This content has been marked as final. Show 9 replies
> I'm currently testing on MX8 if it makes a difference. Altho i will eventually
> trying to make this work on a cf4.5.1 server.
cf4.5? can't recall, does it do java cfx tags? if not, forget it.
in any case, first thing is to make sure that code works w/the iText version
that comes w/cf. what version is that snippet from? if it's very modern then
you'll probably need to use mark mandel's javaLoader to load the newer jar.
My main issue is how to get the multiline attribute out of the field name (PdfFormField.FF_MULTILINE doesn't work in cfscript)
If I can find out how to get that value the rest of the logic is easy.
Its a static property of the PdfFormField class. Use createObject then you can reference the property.
PdfFormField = createObject("java", "com.lowagie.text.pdf.PdfFormField");
WriteOutput("The value of PdfFormField.FF_MULTILINE = "& PdfFormField.FF_MULTILINE);
cool that's what I need. Now how would i request the value of a certain form field? (ie. i have a list of names that I can loop through but need to chk each field for the FF_Multiline value for that field)
> but need to chk each field for the FF_Multiline value for that field
No. I think PdfFormField.FF_MULTILINE is a constant value used to represent that a field is multi-line.
Looks like you extract the field's setting into a variable named "n" here:
PdfNumber n = (PdfNumber)merged.get(PdfName.FF);
The value is then compared to the constant PdfFormField.FF_MULTILINE. If the values are equal it means the field is multiline.
if (n != null && (n.intValue() & PdfFormField.FF_MULTILINE) !=0)
I guess I'm still missing something. Shouldn't I be able to get a value that tells me that a specific field is multiline? I thought the FF_Multiline was specific to a given field?
Here is the complete code I have, altho it does not detect the multiline fields properly.
Try this code, maybe it will clarify things. I'm assuming you're using a version of iText that supports setExtraMargin(). MX7 does not.
Create a PDFName object before the loop:
PdfName = createObject("java","com.lowagie.text.pdf.PdfName");
Change the FOR loop to
For the record, I did have to the alter the code slightly but it works. Too bad this isn't the default. Altho I guess from what i heard this is a acrobat issue of some sort.
Thanks again for all the help!