DANormalizePage
Text, Document manipulation, Direct access functionality, Page manipulation
Description
Moves and/or rotates the contents of the page so that subsequent drawing operations are at the expected position on the page. All the page boundary boxes are adjusted to the physical size of the page and the page's rotation attribute is reset to zero
PDF version behaviour: normalised BleedBox, TrimBox, and ArtBox page dictionary entries require PDF 1.3. When Direct Access normalises a lower-version source and the save version is not locked, DANormalizePage raises the saved document header to PDF 1.3 so it matches the rewritten production boundary boxes
Annotation and form geometry
Normalisation transforms annotation rectangles, text quadrilaterals, line and polygon coordinates, FreeText callouts, ink paths, caption offsets, rectangle differences, and corner radii together with page content
Normal, rollover, down, and named-state appearance streams are copied before rotation, so another page using the original appearance remains unchanged
Widget appearance characteristics and FreeText rotation are adjusted for future appearance regeneration; field values and signature widget placement are preserved
Annotations with NoRotate, and text annotations with their implicit upright behaviour, retain their dimensions and orientation around the transformed upper-left anchor
Shared page content arrays are isolated before content layers are added, and encrypted layers remain readable after save and reload
Validation and limits
Unknown NormalizeOptions values and malformed annotation geometry return 0 with LastErrorCode 111
Annotation geometry is prepared before the page rotation and boundary boxes change; at most 100000 annotations, 32 reference or popup levels, 8 appearance-state levels, and 4000000 point-array coordinates are accepted
Syntax
Delphi
Function TPDFlib.DANormalizePage(FileHandle, PageRef: Integer; NormalizeOptions: Integer): Integer;
ActiveX
Function PDFlib::DANormalizePage(FileHandle As Long, PageRef As Long, NormalizeOptions As Long) As Long
DLL
int DLDANormalizePage(int InstanceID, int FileHandle, int PageRef, int NormalizeOptions);
Parameters
| FileHandle | A handle returned by the DAOpenFile, DAOpenFileReadOnly or DAOpenFromStream functions |
|---|---|
| PageRef | A page reference returned by the DAFindPage or DANewPage functions |
| NormalizeOptions | 0 = Standard normalisation |
Return values
Returns 1 when the page has been normalised. Returns 0 on failure; LastErrorCode reports the reason, for example 111 when NormalizeOptions is not 0 or the annotations cannot be normalised.