Posts in Category "Designer"

Acrobat/Reader 7: using loadXML() to load data can result in an Acrobat crash

Issue

 If you are using loadXML() to load data into a PDF, where the XML contains attributes like “nill=true”, then you may experience an application crash in Acrobat/Reader 7.

For example, if you use Javascript code in your form similar to:

------Form.page1.Button1::click - (JavaScript, client) -----------
try {
    xfa.record.FORM.loadXML(xfa.resolveNode("FORM.page1.txtXMLData").rawValue, true, true);
    xfa.form.remerge();
} catch(err) {
    xfa.host.messageBox("Exception:" + err.name + " - " + err.message);
}

where textXMLData contains the following data:

<?xml version="1.0" encoding="UTF-8"?>
<FORM xmlns="http://www.company.com/testNil" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <CaseManagement>
 <CaseInitiationDate xsi:nil="true" />
 ...
 </CaseManagement>
</FORM>

Reason

 This is a bug in Acrobat/Reader 7.

Solution

 This bug has been fixed in Acrobat/Reader 8.

There is also a simple workaround to this problem:

On the form itself, ensure that the  “attributes” data loading option is set to ignore as follows:

<config>  <present>  <common>  <data>  <attributes>ignore</attributes>  </data> ... 

__________________________________________

reference: (1-16996911/1266068)

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 0.0/10 (0 votes cast)

Acrobat/Reader: how to display the attachment panel automatically in XFA forms

Issue

The attachment panel in Acrobat/Reader does not appear automatically, even when the document does actually contain attachments. It is a common requirement to have the attachment panel show up automatically when opening a form which contains attachments.

Solution

Use the following instructions to check for attachments in the document, and if attachments exist, then show the attachment panel.

1. you will need to edit the form in LiveCycle Designer.

2. add a Button object to the form from the standard library.

3. set the presence of the Button to “Invisible” in the Field properties of the Object Palette (on the right-hand side).

4. goto the click event of the button at the top and enter the following client-side Javascript:

var myDoc = event.target;
var d = myDoc.dataObjects;
if ( d == null ) {
// do nothing
} else {
app.execMenuItem("ShowHideFileAttachment");
}

5. then open the doc::Ready event of the form itself and enter the following client-side Javascript to call the click event of the button when opening the form:

Form.Subform.Button1.execEvent("click");

6. save the form

Note: This solution will work for Acrobat 8. If you wish to use Reader 8, then the solution above will only work if you enable the form with ReaderExtensions server.

Note: To use this solution in Acrobat/Reader 7, then you will need to change the “ShowHideFileAttachment” key to “ShowHideAttachments".

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 0.0/10 (0 votes cast)

LiveCycle Designer: parseInt parses numbers based on a base/radix

Issue

If you are using the parseInt() method in Javascript, you may receive some unexpected results. This is especially true if you are using any kind of prefixes in the value.

For example:

parseInt(“09″) would return “0”

and parseInt(“045″) would return “55”

Solution

Use parseFloat() to get expected results for numbers that are prefixed with “0”.  Use parseInt(“09″, 10), where 10 specifies the base, that is, decimal.

Additional Information

The “0” prefix causes the unexpected results from parseInt(). Numbers with a “0” prefix are taken as octal (base 8 ) numbers as opposed to decimal numbers. As a result, the octal 55 is equal to a decimal 45.

parseInt syntax: parseInt('string' [, base])

How it works:

The first argument of parseInt must be a string or a string expression. The result returned by parseInt is an integer whose representation was contained in that string (or the integer found in the beginning of the string). The second argument (base), if present, specifies the base (radix) of the number whose string representation is contained in the string. The base argument can be any integer from 2 to 36.

If there is only one argument, the number base is detected according to the general JavaScript syntax for numbers. Strings that begin with 0x or -0x are parsed as hexadecimals; strings that begin with 0 or -0 are parsed as octal numbers. All other strings are parsed as decimal numbers.

If the string argument cannot be parsed as an integer, the results will be different in different interpreters (either 0 or NaN).

Examples (comments in each line give the conversion results):

parseInt('123.45') // 123
parseInt('77') // 77
parseInt('077',10) // 77
parseInt('77',8) // 63 (= 7 + 7*8)
parseInt('077') // 63 (= 7 + 7*8)
parseInt('77',16) // 119 (= 7 + 7*16)
parseInt('0x77') // 119 (= 7 + 7*16)
parseInt('099') // 0 (9 is not an octal digit)
parseInt('99',8) // 0 or NaN, depending on the platform
parseInt('0.1e6') // 0
parseInt('ZZ',36) // 1295 (= 35 + 35*36)

_____________________________________
reference: (1-16936533)

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 10.0/10 (1 vote cast)

LiveCycle Designer: Unable to initialize ACE interface

Issue

 If you are working with Designer on terminal server, you may experience intermittent problems starting the Designer client, such as the following error:

Unable to initialize ACE interface

Reason

Designer 6 or 7 are not supported on Terminal Server.  Designer versions 8 and later are supported on terminal server.

There is an ACE.dll in the designer product folder, which is the Adobe Colour Engine.

Solution

 As a workaround, you can copy the ace.dll from the Reader/Acrobat installation folder, and overwrite the one in the Designer folder.  Make a backup of the Designer ACE.dll first.  This has been known to resolve the issue for some customers.

reference: (1-16374929)

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 7.5/10 (2 votes cast)