User Tools

Site Tools


annual_school_census_pdf_survey_user_manual

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
annual_school_census_pdf_survey_user_manual [2024/11/11 04:00] ghacheyannual_school_census_pdf_survey_user_manual [2024/11/11 04:05] (current) – [PDF Intricacies Notes and Primer] ghachey
Line 117: Line 117:
  
 One other thing, itext allows you to save PDF with no compression so most of it (except images) is plain text. This make this level of debugging possible. One other thing, itext allows you to save PDF with no compression so most of it (except images) is plain text. This make this level of debugging possible.
 +
 +So the code you identified does set the Appearance Dictionary of each box, and these render correctly except when the Preferences force a “dynamic” render.   
 +
 +In that circumstance, Acrobat basically ignores the /AP rendering code, and tries to build its own renderer.
 +
 +Prior to the changes last night, it would get the wrong icon for this, and you may be right – it takes the icon associated with the first of the two child widgets linked to the field.
 +
 +This linkage fyi goes in both directions – via the parent element on the widget, which points to the field:
 +
 +{{ :annual-census-user-manual:pdf-internals-1.png?nolink&400 |}} 
 +
 +And via the Kids array of the field, which points to the widgets.
 +
 +{{ :annual-census-user-manual:pdf-internals-2.png?nolink&400 |}} 
 +
 +So with nothing better to go on, Acrobat was looking at the first Kid, and this was here it was making mistakes.
 +
 +But now, when constructing the “dynamic” rendering, it can use the /MK Appearances Characteristics dictionary, to get the symbol, and border color:
 +
 +{{ :annual-census-user-manual:pdf-internals-3.png?nolink&400 |}} 
 +
 +With this information, it contructs the “dynamic” rendering pretty close to the customised rendering. (except for the Text color).
 +
 +Small point, “dynamic rendering” is only used on the ‘Normal View’ of the widget, the Down view (ie mouse down) still uses the /D appearance in the /AP dictionary; this is why you get the darker grey background when the mouse is pressed. Also the Focus appearance uses the /N Normal appearance from the /AP dictionary even when “dynamic rendering” is on: this is why you’ll see a tick go green when you click, it, when it loses focus it turns black (ie swaps to the dynamic rendering.
 +
 +In Acrobat the #0 #1 Is just a shorthand to enumerate the Kids array during editing. Its not recorded in the PDF. IT seems that it reflects the order in the Kids array:
 +
 +{{ :annual-census-user-manual:pdf-internals-4.png?nolink&400 |}}  
 +
 +In the pair 15816 15817 its 15816 that is N:
 +
 +{{ :annual-census-user-manual:pdf-internals-5.png?nolink&400 |}}  
 +
 +The parent 14808 of this OnStaff field is:
 +
 +{{ :annual-census-user-manual:pdf-internals-6.png?nolink&400 |}}  
 +
 +Ie that field is TL.04.OnStaff
 +
 +But this ordering has no impact on the data collection as the expert values Y and N are correctly set on the left and right widgets. It can make a difference to the rendering, but the change I made last night to add /MK information is probably more robust.
  
annual_school_census_pdf_survey_user_manual.txt · Last modified: 2024/11/11 04:05 by ghachey