代码之家  ›  专栏  ›  技术社区  ›  Brandon

AdobeAcrobat正在毫无理由地重复一个表单

  •  0
  • Brandon  · 技术社区  · 15 年前

    然后将其另存为pdf。如果打开pdf并保存,您将看到子窗体从显示一次变为显示两次。有人知道为什么保存表单时,此代码/标记会导致创建表单的另一个实例吗?

    我对LiveCycle还不够熟悉,无法理解所有生成的语法,但似乎没有什么东西可以做到这一点。我认为可能是负责添加另一个表单实例的按钮在我不知道的情况下启动了,但情况似乎并非如此,因为完全删除按钮并不能解决问题。

           <subform y="1498.455mm" w="190.5mm" minH="9.234mm" layout="tb" name="ScheduleOne">
              <subform w="100.783mm" minH="6.349mm" layout="tb" name="Form">
                 <subform y="47.164mm" w="190.5mm" minH="6.349mm" layout="tb" name="Form">
                    <draw name="Text17" minH="6.349mm" w="190.455mm">
                       <ui>
                          <textEdit>
                             <border>
                                <?templateDesigner StyleID aped1?>
                                <edge presence="hidden"/>
                                <edge presence="hidden"/>
                                <edge/>
                                <edge presence="hidden"/>
                             </border>
                             <margin/>
                          </textEdit>
                       </ui>
                       <value>
                          <text>subForm</text>
                       </value>
                       <font typeface="Times New Roman" size="11pt"/>
                       <margin topInset="0mm" bottomInset="0mm"  leftInset="0mm" rightInset="0mm"/>
                       <para vAlign="middle" marginLeft="0pt" hAlign="center"/>
                       <traversal>
                          <traverse ref="ButtonGroup1[0].Button1[0]"/>
                       </traversal>
                    </draw>
                    <occur max="-1"/>
                    <keep intact="contentArea"/>
                    <?templateDesigner expand 1?></subform>
                 <subform name="ButtonGroup1" layout="lr-tb" relevant="- print" minH="6.017mm" w="190.5mm">
                    <keep intact="contentArea" previous="contentArea"/>
                    <margin bottomInset="1mm" leftInset="147.828mm" topInset="1mm"/>
                    <traversal>
                       <traverse operation="first" ref="Button1[0]"/>
                    </traversal>
                    <field relevant="-print" h="6mm" name="Button1" w="20mm">
                       <border hand="right">
                          <edge stroke="raised"/>
                          <fill>
                             <color value="212,208,200"/>
                          </fill>
                          <?templateDesigner StyleID apbx2?>
                          <?templateDesigner StyleID apbx2?>
                          <?templateDesigner StyleID apbx2?>
                          <?templateDesigner StyleID apbx2?>
                          <?templateDesigner StyleID apbx2?></border>
                       <caption>
                          <font typeface="Arial" size="9pt"/>
                          <para hAlign="center" vAlign="middle"/>
                          <value>
                             <text>Remove</text>
                          </value>
                       </caption>
                       <font typeface="Myriad Pro"/>
                       <ui>
                          <button highlight="inverted"/>
                       </ui>
                       <bind match="none"/>
                       <event activity="click" name="event__click">
                          <script contentType="application/x-javascript">
    
    var inst = Form.instanceManager;
    
    if (inst.count &gt; 1) {
         inst.removeInstance(inst.count - 1); } else {
        xfa.host.messageBox("The minimum allowable number of fields is 1. You cannot remove any more fields.", "Warning", 3); }</script>
                       </event>
                       <traversal>
                          <traverse ref="Button1[1]"/>
                       </traversal>
                    </field>
                    <subform h="1.27mm" name="Subform1" w="2.54mm"/>
                    <field relevant="-print" h="6mm" name="Button1" w="20mm">
                       <border hand="right">
                          <edge stroke="raised"/>
                          <fill>
                             <color value="212,208,200"/>
                          </fill>
                          <?templateDesigner StyleID apbx2?></border>
                       <caption>
                          <font typeface="Arial" size="9pt"/>
                          <para hAlign="center" vAlign="middle"/>
                          <value>
                             <text>Add More</text>
                          </value>
                       </caption>
                       <font typeface="Myriad Pro"/>
                       <margin leftInset="0mm"/>
                       <ui>
                          <button highlight="inverted"/>
                       </ui>
                       <bind match="none"/>
                       <event activity="click" name="event__click">
                          <script contentType="application/x-javascript">
    Form.instanceManager.addInstance(1);</script>
                       </event>
                       <traversal>
                          <traverse ref="Text16[0]"/>
                       </traversal>
                    </field>
                    <?templateDesigner expand 0?></subform>
                 <draw name="Text16" w="190.455mm">
                    <ui>
                       <textEdit/>
                    </ui>
                    <value>
                       <text>MainForm</text>
                    </value>
                    <font size="9pt" typeface="Arial"/>
                    <margin topInset="0mm" bottomInset="0mm" leftInset="0mm" rightInset="0mm"/>
                    <traversal>
                       <traverse ref="ButtonGroup2[0].Button1[0]"/>
                    </traversal>
                    <para hAlign="center"/>
                 </draw>
                 <occur max="-1"/>
                 <keep intact="contentArea"/>
                 <?templateDesigner expand 0?></subform>
              <subform name="ButtonGroup2" layout="lr-tb" relevant="- print" minH="6.017mm" w="190.5mm">
                 <keep intact="contentArea" previous="contentArea"/>
                 <margin bottomInset="1mm" leftInset="147.828mm"  topInset="1mm"/>
                 <traversal>
                    <traverse operation="first" ref="Button1[0]"/>
                 </traversal>
                 <field relevant="-print" h="6mm" name="Button1" w="20mm">
                    <border hand="right">
                       <edge stroke="raised"/>
                       <fill>
                          <color value="212,208,200"/>
                       </fill>
                       <?templateDesigner StyleID apbx2?>
                       <?templateDesigner StyleID apbx2?>
                       <?templateDesigner StyleID apbx2?>
                       <?templateDesigner StyleID apbx2?>
                       <?templateDesigner StyleID apbx2?></border>
                    <caption>
                       <font typeface="Arial" size="9pt"/>
                       <para hAlign="center" vAlign="middle"/>
                       <value>
                          <text>Remove</text>
                       </value>
                    </caption>
                    <font typeface="Myriad Pro"/>
                    <ui>
                       <button highlight="inverted"/>
                    </ui>
                    <bind match="none"/>
                    <event activity="click" name="event__click">
                       <script contentType="application/x-javascript">
    
    var inst = Form.instanceManager;
    
    if (inst.count &gt; 1) {
         inst.removeInstance(inst.count - 1); } else {
        xfa.host.messageBox("The minimum allowable number of fields is 1. You cannot remove any more fields.", "Warning", 3); }</script>
                    </event>
                    <traversal>
                       <traverse ref="Button1[1]"/>
                    </traversal>
                 </field>
                 <subform h="1.27mm" name="Subform1" w="2.54mm"/>
                 <field relevant="-print" h="6mm" name="Button1" w="20mm">
                    <border hand="right">
                       <edge stroke="raised"/>
                       <fill>
                          <color value="212,208,200"/>
                       </fill>
                       <?templateDesigner StyleID apbx2?></border>
                    <caption>
                       <font typeface="Arial" size="9pt"/>
                       <para hAlign="center" vAlign="middle"/>
                       <value>
                          <text>Add More</text>
                       </value>
                    </caption>
                    <font typeface="Myriad Pro"/>
                    <margin leftInset="0mm"/>
                    <ui>
                       <button highlight="inverted"/>
                    </ui>
                    <bind match="none"/>
                    <event activity="click" name="event__click">
                       <script contentType="application/x-javascript">
    Form.instanceManager.addInstance(1);</script>
                    </event>
                 </field>
                 <?templateDesigner expand 0?></subform>
              <traversal>
                 <traverse operation="first" ref="Form[0].Form[0].Text17 [0]"/>
              </traversal>
              <?templateDesigner expand 1?></subform>
    
    1 回复  |  直到 15 年前
        1
  •  1
  •   Brandon    15 年前

    因此,通过删除一个空的子表单,“修复”了这个问题。没有人知道为什么,但是删除子表单并为所有元素指定唯一的名称可以防止元素重复。