合并第一行的后4列(选中这4个单元格然后反手键选择“merge cells”)效果如下
向对应的单元格中写入内容(注意前两列把字分别写入了2行中)
选中第一行的前2列的单元格,然后打开paragraph 然后选择
align bottom
同样第2行的前2列选择
align top ,最后如下图
预览一下效果
前两列多了横线,现在来“删除”这条线
选中第一行的前2列的单元格,选择border选项卡,edges下拉框中选择Edit Individually
然后把他们的下边框设置为
None
同理把第2行的前两列单元格的上边框设置为None 好了 预览一下:
如果想要改变某个单元格的数值只要拖动边框调整即可
12. 导入xml数据到pdf中
1. var _length2;
2. function importData(){ 3. var oObj = event.target;
4. var xmlObj = oObj.importDataObject(dataObj); 5. if(xmlObj) { 6. var dataPath = oObj.getDataObject(dataObj)[path]; 7. if(dataPath.length!=dataPath.lastIndexOf(.xml)+4){
8. app.alert(导入的文件应该是一个xml格式的文件,请重新选择正确的文件。); 9. }else{ 10. try{ 11. var oFile =
oObj.getDataObjectContents(dataObj); 12. var cAcrobat = util.stringFromStream(oFile, GBK); 13. var index_1 = cAcrobat.indexOf(
);14. cAcrobat = cAcrobat.substr(index_1-1); 15. cAcrobat =
encoding=\\UTF-8\\?>
16. var myXML = XMLData.parse(cAcrobat,false); 17. loopThrough(myXML);
18. //remove the attachment/dataObj from the PDf 19. oObj.removeDataObject(dataObj); 20. }catch(e){ 21. app.alert(e); 22. } 23. } 24. } else {
25. app.alert(导入文件失败, 0); 26. } 27. } 28.
29.
30. function loopThrough(thisXML) { 31. //删除所有直接抵免动态增加行 32. var oFields =xfa.resolveNodes(taxML.form3.Table1.Row2[*]);//得到对象oFields直接抵免
33. var nNodesLength = oFields.length; //得到有多少个oFields
34. for(var nNodeCount=0;nNodeCount taxML.form3.Table1.Row2.instanceManager.removeInstance(nNodesLength-nNodeCount-1); 36. } 37. // 38. var obj=XMLData.applyXPath( thisXML, taxML/body/sbbQysds2008NdAFb012/item) 39. if(obj!=null){ 40. _length2=obj.length; 41. } 42. // 43. var xPath2 = XMLData.applyXPath( thisXML, taxML/body/sbbQysds2008NdAFb012/*);// */ 44. for ( var i = 0; i < xPath2.length; i++) { 45. loopThroughInternal2( xPath2.item(i) ); 46. } 47. 48. 49. var xPath = XMLData.applyXPath( thisXML, taxML/body/sbbQysds2008NdAFb011/*);// */ 50. for ( var i = 0; i < xPath.length; i++) { 51. loopThroughInternal( xPath.item(i) ); 52. } 53. 54. } 55. 56. function loopThroughInternal(thisObject) { 57. var somExp = thisObject.somExpression; 58. var xfaNode = xfa.resolveNode(somExp); 59. if(xfaNode == null){ 60. return; 61. } 62. var className = xfaNode.className; 63. var subNodes = thisObject.nodes; 64. if( subNodes.length >0 ){ 65. for ( var x = 0; x < subNodes.length; x++) { 66. loopThroughInternal(subNodes.item(x)); 67. } 68. }else{ 69. 70. if (thisObject.value != null ) { 71. //app.alert(somExp); 72. xfa.resolveNode(somExp).value = thisObject.value; 73. } 74. } 75. } 76. 77. function loopThroughInternal2(thisObject) { 78. var somExp = thisObject.somExpression; 79. var xfaNode = xfa.resolveNode(somExp); 80. if(xfaNode == null){ 81. return; 82. }