Forces one or more pages to be loaded into memory.
Use attachPage to ensure that the entire form and all of its pages are loaded into memory and are accessible to API functions. Forms that use the XFDL pageloading option do not always have all pages of the form loaded into memory. Although some functions might appear to work properly on pages that are not loaded, the results are not accurate. For example, UFLCheckValidFormats
will not report errors from pages that are not loaded, and you cannot print pages that are not loaded.
It is safe to call UFLAttachPage
on pages that are already loaded. It is also safe to call UFLAttachPage
on forms that do not use the XFDL pageloading option.
Table 1. Function parameters
|pageSID||r_charP||The sid of the page to attach, or NULL to attach all pages. |
The following example loads in a form, calls UFLAttachPage
to ensure that the entire form and all of its pages are loaded into memory, then calls UFLCheckValidFormats
Parent topic: FormNodeP functions
/* read in a form that has <pageloading> enabled */
if ((*theForm = UFLReadForm("sample.xfdl", 0)) == NULL)
fprintf(stderr, "Could not load form.\n");
/* attach all pages before calling UFLCheckValidFormats */
/* call UFLCheckValidFormats */
UFLCheckValidFormats(theForm, &invalidItems, &invalidItemsSize);
if (invalidItemsSize == 0)
printf("All items in the form have correctly formatted values. \n");
printf("One or more items in the form have a non valid format. \n");