Adobe Acrobat 无缘无故地重复表单

发布于 2024-08-07 17:45:31 字数 10061 浏览 11 评论 0原文

这是一个简单的表格来帮助说明这个问题。这不是表单的完整代码,因为它太长(或者更臃肿)而无法发布。因此,如果您打开 Adob​​e LiveCycle 并创建一个空白文档,请插入以下内容作为主要内容。

然后将其另存为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>

Heres a simple form to help illustrate the issue. This is not the complete code for a form since it was way too long (or bloated rather) to post. So if you open Adobe LiveCycle and create a blank document, insert the following as the main content.

Then save it as a pdf. If you open the pdf and save it you'll see the subform went from showing up once to showing up twice. Does anyone see why this code/markup would cause another instance of the form to be created when it has been saved?

I'm not that familiar enough with LiveCycle to understand all of the generated syntax, but it doesn't seem like anything should be doing this. I thought that maybe the buttons responsible for adding another instance of the form were firing without me knowing, but that doesn't seem to be the case as removing the buttons entirely doesn't resolve the issue.

       <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 > 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 > 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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

荒芜了季节 2024-08-14 17:45:31

所以这个问题通过删除一个空的子表单来“解决”。没有人知道为什么,但是删除子表单并为所有元素赋予唯一的名称可以防止元素重复。

已将此错误报告给 Adob​​e。

So this problem was "fixed" by removing an empty subform. No one has any idea why, but removing the subform and giving all the elements unique names keeps the elements from duplicating.

It's been reported as a bug to Adobe.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文