#61
|
|||
|
|||
![]()
Oh interesting didn't know they were reversed. Good to know.
And my main problem was Top and Bottom go in 10ths and Left and Right go in 100ths Thanks.
__________________
Don Reimer - JavaScript Novice MAC OS 10.14.6 Acrobat DC FP Creator 12.0.1 |
#62
|
||||
|
||||
![]()
It's been too long for this thread to not have something in it so...I have the following simple code which just loops through a set amount of iterations to create a generic table. Everything worked fine until I wanted to add the colors to the rows to make it look like GreenBar paper. Yea I know I'm really dating my age here, but oh well. I took the coding Dan placed earlier
Code:
myTable.ShadingColor1 = "Blue"; myTable.ShadingPct1 = 20; myTable.ShadingRepeat1 = 1; myTable.ShadingColor2 = "Red"; myTable.ShadingPct2 = 40; myTable.ShadingRepeat2 = 1; myTable.ShadingType = "ByRows"; Code:
var tableRows = 10; var colHead1 = 'Record'; var colHead2 = 'First Name in Stack'; var colHead3 = 'Record'; var colHead4 = 'Last Name in Stack'; var colHead5 = 'Print File Name'; var myTable = new FPTable; myTable.ShadingColor1 = "Blue"; myTable.ShadingPct1 = 20; myTable.ShadingRepeat1 = 1; myTable.ShadingColor2 = "Red"; myTable.ShadingPct2 = 40; myTable.ShadingRepeat2 = 1; myTable.ShadingType = "ByRows"; myTable.AddColumns(10800, 10800, 10800, 10800, 10800); myTable.AddRow(); myTable.Rows[0].Cells[0].Margins = new FPTableMargins; myTable.Rows[0].Cells[0].Margins.Top = 23; myTable.Rows[0].Cells[0].Margins.Bottom = 23; myTable.Rows[0].Cells[0].Margins.Right = 10; myTable.Rows[0].Cells[0].Margins.Left = 10; myTable.Rows[0].Cells[0].Font="PNCSans"; myTable.Rows[0].Cells[0].PointSize=9.5; myTable.Rows[0].Cells[0].VAlign = "Middle" myTable.Rows[0].CopyCells(0, 1, 2, 3, 4); myTable.Rows[0].SetContents(colHead1, colHead2, colHead3, colHead4, colHead5); myTable.Rows[0].Type = "Header"; for ( var a = 1; a <= tableRows; a++) { myTable.AddRow(); myTable.Rows[a].Cells[0].Margins = new FPTableMargins; myTable.Rows[a].Cells[0].Margins.Top = 23; myTable.Rows[a].Cells[0].Margins.Bottom = 23; myTable.Rows[a].Cells[0].Margins.Right = 100; myTable.Rows[a].Cells[0].Margins.Left = 10; myTable.Rows[a].Cells[0].Font="PNCSans"; myTable.Rows[a].Cells[0].PointSize=8.4; myTable.Rows[a].Cells[0].VAlign = "Middle" myTable.Rows[a].CopyCells(0, 1, 2, 3, 4); myTable.Rows[a].Cells[0].Content = "Record 1-"+a; myTable.Rows[a].Cells[1].Content = "First Name 1-"+a; myTable.Rows[a].Cells[2].Content = "Record 2-"+a; myTable.Rows[a].Cells[3].Content = "First Name 2-"+a; myTable.Rows[a].Cells[4].Content = "Print File_"+a; } return myTable.MakeTags();
__________________
David A. Sweet Variable Data Specialist HKM Direct Market Communications Windows 7, Acrobat 10.x FusionPro Desktop and Server 10.0.26 |
#63
|
||||
|
||||
![]() Quote:
__________________
Ste Pennell FusionPro VDP Creator 9.3.15 Adobe Acrobat X 10.1.1 Mac OS X 10.12 |
#64
|
||||
|
||||
![]()
Thanks Step. I really thought I had "copy and pasted" it. Not quite sure as to why it came out differently. Guess my mind is slipping.
Thanks again. .
__________________
David A. Sweet Variable Data Specialist HKM Direct Market Communications Windows 7, Acrobat 10.x FusionPro Desktop and Server 10.0.26 |
#65
|
||||
|
||||
![]() Quote:
While thumbing through the section on tables in the TagsRefGuide, I noticed a "space" attribute and found that if you define space above (or below) the table, all of the cells magically become centered again: Code:
var myTable = new FPTable; myTable.AddColumns(16000, 6000, 6000, 6000, 6000, 6000); // Add the top row var topRow = myTable.AddRow(); topRow.Cells[0].HAlign = "Center"; topRow.Cells[0].VAlign = "Middle"; topRow.Cells[0].SetBorders("Thin", "Black", "Top", "Bottom", "Right", "Left"); topRow.Cells[0].Font="Times New Roman"; topRow.Cells[0].PointSize=11; topRow.Cells[0].Bold="On"; topRow.CopyCells(0,1,2,3,4,5); topRow.SetContents("Your Monthly Amount", "$100", "$250", "$500", "$1,000", "$5,000"); // Add the bottom row var bottomRow = myTable.AddRow(); bottomRow.Cells[0].SetBorders("Thin", "Black", "Top", "Bottom", "Right", "Left"); bottomRow.Cells[0].ShadeColor="Black"; bottomRow.Cells[0].ShadePct=15; bottomRow.Cells[0].Font="Times New Roman"; bottomRow.Cells[0].PointSize=11; bottomRow.Cells[0].Bold="On"; bottomRow.CopyCells(0,1,2,3,4,5); bottomRow.SetContents("Our Offer To You", "100", "250", "500", "1000", "5000"); // Center the table in the text box return myTable.MakeTags().replace(/^\<table/, '<table space="above:1" alignment=center');
__________________
Ste Pennell FusionPro VDP Creator 9.3.15 Adobe Acrobat X 10.1.1 Mac OS X 10.12 |
#66
|
||||
|
||||
![]()
Yes, in FusionPro 9.3.36 and later, you can specify the leading mode as 9.3 on the Global Paragraph Settings dialog, which improves several issues like this regarding text layout in tables.
__________________
Dan Korn FusionPro Developer / JavaScript Guru / Forum Moderator PTI Marketing Technologies | Printable | MarcomCentral I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com. Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs. This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data. Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages. Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance. Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support. How To Ask Questions The Smart Way The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript. Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5. return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)}); ![]() |
#67
|
|||
|
|||
![]()
What is the proper tag for assigning a Title to a table?
__________________
Windows 10 - FusionPro 10.0.26; Acrobat DC; Steve Davenport Variable Communications |
#68
|
||||
|
||||
![]()
It's the <title> tag, as documented in the FusionPro Tags Reference. But there's no corresponding property in the JavaScript table API, because, quite frankly, it's just as easy to put the title in the text frame before the rule that builds the table.
__________________
Dan Korn FusionPro Developer / JavaScript Guru / Forum Moderator PTI Marketing Technologies | Printable | MarcomCentral I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com. Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs. This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data. Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages. Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance. Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support. How To Ask Questions The Smart Way The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript. Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5. return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)}); ![]() |
![]() |
Tags |
javascript, tables |
Thread Tools | Search this Thread |
Display Modes | |
|
|