Avatar

Correct answer by
Level 10

The crux is, that the template DOM of a XFA form is read only so you can't delete anything of it. What you can manipulate is the form DOM, which is the current representation of the form created from the combination of the template and data. However, this won't solve your problem. What you can do to reduce the file size is to reduce the image sizes by reducing the resolution and colors. For a 50 × 30 mm sized logo the image has to be only 590 × 354 pixels to have 300 dpi. If it has only one or a few colors, reduce the colors (indexed colors) in the image file to 16 or less. This can reduce the size often about 90 %. And finally, do not select the checkbox to embed the image in the form, because then it will get stored as a Base64-encodes string in the template DOM which is around 30 % larger that the hex-encoded stream object it will get stored in the PDF otherwise.

View solution in original post