Jump to content

Dan Korn

Members
  • Posts

    4,884
  • Joined

  • Days Won

    17

Everything posted by Dan Korn

  1. This seems like an issue with parsing the Data Definition (.def) file. Usually errors like this are a result of composing a job made in a newer version of FP Desktop with an older version of FP Server or Direct. But I'd need a bit more context in order to analyze the issue further.
  2. You can simply click the "I" button on the Variable Text Editor dialog to underline the selection, or output a <u> tag from a rule. However, you can't control the position or weight of the underline. Although you may be able to do some tricks with table cell borders and text measurement, depending on how the underlined text flows with other text.
  3. What you're really talking about here is setting up an automated workflow to handle different kinds of orders. And frankly, FusionPro Desktop is not the appropriate tool for that kind of task. You really should be using FusionPro Server, which allows you much more control over the composition parameters. Specifically, you could have a custom application which would count the number of records, or even run a "dummy" FusionPro composition and read the number of records from our XML log file, then set the appropriate FPI (imposition) file in the CFG (job options) file for the final composition. That said, we are looking at some imposition enhancements for a future release, but it's likely that the kind of enhancement we're talking about here, to do "on the fly" imposition, would still be for FP Server only.
  4. I think one of these two solutions will be your best bet: http://forums.printable.com/showpost.php?p=1595&postcount=2 http://forums.printable.com/showpost.php?p=2888&postcount=2 The first one will be easier to extend to more than two frames.
  5. No, there's only one FPI (imposition) template file per composition. The OnNewOutputFile rule can only change the output file name. Imposition is, by definition, applied to all records in your output, since you could be stacking all the records. What is it that you're trying to do?
  6. No, you can only use a named color with the text frame properties. However, you can use a "solid block" character, copyfitted to fill another frame behind your frame, with a tag to specify any arbitrary color, with a rule such as this: return '<color cmyk=77777777><f name="Arial Unicode MS"><unicode>2588</unicode></f></color>';
  7. You want to use the sample in this thread to get started: http://forums.printable.com/showthread.php?t=37 Once you get the right pages going to the output, you can set up saddle stitch imposition.
  8. Yes, you can use the alignment attribute of the <table> tag to control the alignment of the table itself within the text frame, as documented in the FusionPro Tags Reference Guide. Specifically, <table alignment=center>. Unfortunately, though, there's no property in the JavaScript Table API which corresponds to this. However, it's pretty easy to modify the tagging returned from the FPTable.MakeTags function, like so: var TableTags = myFPTableObject.MakeTags().replace(/^\<table/, "<table alignment=center");
  9. In what way do they not seem to load? Exactly what are you doing, and exactly what is the result? Are you trying to open a .fpi file by double-clicking it in the Finder? Or are you using File -> Open within the FP Imposer app? What error message do you get? Also, what version of Mac OS X are you running?
  10. Sure, just call the function with whatever date you want, like so: return SpanishDate(DateFromString(Field("Date1"))); You can put the SpanishDate function in your JavaScript Globals if you need to access it from multiple rules.
  11. Try this: function SpanishDate(myDate) { var months = ['enero','febrero','marzo','abril','mayo','junio','julio','agosto','septiembre','octubre','noviembre','diciembre']; var days = ['domingo','lunes','martes','miércoles','jueves','viernes','sábado']; var month = months[myDate.getMonth()]; var day = days[myDate.getDay()]; return day + " " + myDate.getDate() + " de " + month + " de " + myDate.getFullYear(); } return SpanishDate(Today());
  12. Hi David, That's a fairly complex custom workflow scenario, and I'm not sure I can answer your questions about it completely, at least not in the context of this user-to-user forum (although it's possible that another user may have a similar workflow and would be able to chime in). I suggest contacting Support; they can route your request to the appropriate folks here who can help you, possibly negotiating an enhancement to the product and/or some custom consulting. Thanks!
  13. It is true that the entire file is read into the JavaScript object, in memory, and that it does hang around for the entire composition. You could delete the object when you're done with it, but because JavaScript uses deferred garbage collection internally, there's no guarantee of when the memory will actually be released. Let's take a step back and see if we can figure out another way to do what you're trying to do. What is it that you're ultimately trying to accomplish with the number of records?
  14. Please start a new thread with your chart-specific questions, so that we can keep this thread about the table API. Thanks.
  15. If you only want to generate the chart data dynamically, that's easy to do with JavaScript. You don't need a .txt file at all. The tagging for a chart is much simpler than it is for a table - the only tags allowed are <row> and <cell> tags. So it's pretty simple to generate those tags in a rule like this: var chart = '<row type=header><cell>foo<cell>bar<cell>abc'; chart += '<row><cell>' + Field("foo"); chart += '<cell>' + Field("bar"); chart += '<cell>' + Field("abc"); return chart;
  16. Not at this time. Chart formats are defined in the Chart Properties GUI, not via tags as tables are, so wrapping that functionality in a JavaScript object is much more complicated. You can use the DIF API to modify chart formats if you're developing with FusionPro Server. What kind of dynamic chart generation are you looking for? If you want to suggest an API or post an example of the kind of code you'd like to be able to write, I can make an enhancement case for it.
  17. The JavaScript table object in FusionPro 7.0, new FPTable, must be declared at the beginning of a table, followed by the number of columns that the table will use. Columns are defined in 100ths of a point. The example below shows 4 columns that are each an inch wide. The number of rows can be added row by row, or at the beginning of the table. new FPTable; var myTable = new FPTable; myTable.AddColumns(7200, 7200, 7200, 7200); myTable.AddRows(2); At the end of the table, the MakeTags() function must be called: return myTable.MakeTags(); There are 2 ways to set content for the cells. The first row and column in a table is always 0. Text Fields, static type or even graphic images can be placed inside a cell: myTable.Rows[0].Cells[0].Content = "Hello"; myTable.Rows[0].Cells[1].Content = Field("FName"); myTable.Rows[0].Cells[2].Content = "Goodbye"; myTable.Rows[0].Cells[3].Content = Field("LName"); The second way is can also set the content of all the cells in an entire row like this: myTable.Rows[1].SetContents("Hi", Field("FName"), "Bye", Field("LName")); It is possible to copy content and formatting from one cell to another in a row. In the example below, the content is set into cell 2,0 and then copied into cells 2,1 / 2,2 / 2,3. myTable.Rows[2].Cells[0].Content = "Bon Jour"; myTable.Rows[2].CopyCells(0, 1,2,3); In this example, thin Black borders are applied to cell 0,0 and then copied to cells 0,1 / 0,2 / 0,3. myTable.Rows[0].Cells[0].SetBorders("Thin", "Black", "Top", "Bottom", "Right", "Left"); myTable.Rows[0].CopyCells(0, 1,2,3); When copying the formatting of one cell to another, it is important to remember to set the content of the subsequent cells after the formatting is done (unless the content is also meant to be the same). The following pages show more examples of ways to format a cell. Shading: Two properties for Shading are Shade Color and Shade Percent. myTable.Rows[1].Cells[0].ShadeColor="Black"; myTable.Rows[1].Cells[0].ShadePct=20; There are two more properties for Shading which are Shading Repeat and Shading Type. This allows you to specify 2 (or more) different shading values so that you can alternate shading between rows or columns. The two properties for Shading Type are "ByRow" or "ByColumn". myTable.ShadingColor1 = "Blue"; myTable.ShadingPct1 = 20; myTable.ShadingRepeat1 = 1; myTable.ShadingColor2 = "Red"; myTable.ShadingPct2 = 40; myTable.ShadingRepeat2 = 1; myTable.ShadingType = "ByRow"; //or "ByColumn" SetBorders: The 2 border properties include thickness and location. Values for thickness are "Thin", "Medium," "Thick" and "None". If no parameter is specified, the border will default to none. Values for location are "Top," "Bottom," "Right" and "Left". myTable.Rows[0].Cells[0].SetBorders("Thin", "Black", "Top", "Bottom); Font Formatting: The 3 properties for font formatting are Font Face, Text Color and Point Size. myTable.Rows[2].Cells[0].Font="Times New Roman"; myTable.Rows[2].Cells[0].TextColor="Red"; myTable.Rows[2].Cells[0].PointSize=15; Bold/Italics: Below is an example of how to apply Bold and Italic formatting to text in a cell: myTable.Rows[2].Cells[0].Bold="On"; myTable.Rows[2].Cells[0].Italic="On"; Margins: To use table margins, the new FPTableMargins object must be declared. Once the new FPTableMargins object is called, the 4 parameters that can be used are Top, Bottom, Left and Right. The margins for top and bottom are called out in 10ths of a point. For left and right they are called out in 100ths of a point myTable.Rows[2].Cells[0].Margins = new FPTableMargins; myTable.Rows[2].Cells[0].Margins.Top = 50; myTable.Rows[2].Cells[0].Margins.Bottom = 50; Rotation: The contents of a cell can be rotated by using the rotation property. Valid values for rotation are 0, 90, 180, or 270. myTable.Rows[3].Cells[0].Rotate = 90; To combine or merge cells together, HStraddle and VStraddle can be used to straddle cells both Horizontally and Vertically: myTable.Rows[3].Cells[0].HStraddle = 2; myTable.Rows[3].Cells[2].VStraddle = 2; To align content within cells horizontally, the HAlign property can be used with the values of "Left", "Right" and "Center": myTable.Rows[3].Cells[0].HAlign = "Left"; myTable.Rows[3].Cells[1].HAlign = "Right"; myTable.Rows[3].Cells[2].HAlign = "Center"; To align content within cells vertically, the VAlign property can be used with the values of "Top", "Bottom" and "Middle": myTable.Rows[3].Cells[0].VAlign = "Top"; myTable.Rows[3].Cells[1].VAlign = "Bottom"; myTable.Rows[3].Cells[2].VAlign = "Middle"; Advanced Settings: It is possible to specify a row in a table to be a header type and a footer type. When a row is specified as a header or footer, it will repeat on overflow pages. myTable.Rows[0].Type = "Header"; myTable.Rows[4].Type = "Footer"; There is also a way to skip a row in a table if needed. This could be based on some conditional logic. myTable.Rows[0].Type = "Skip"; //removes the row from the table Below is a sample table rule (containing 2 text fields for first and last name) and the resulting output: var myTable = new FPTable; myTable.AddColumns(7200, 7200, 7200, 7200); myTable.AddRows(3); myTable.Rows[0].Cells[0].Font="Times New Roman"; myTable.Rows[0].Cells[0].TextColor="Red"; myTable.Rows[0].Cells[0].SetBorders("Thin", "Black", "Top", "Bottom", "Right", "Left"); myTable.Rows[0].CopyCells(0, 1,2,3); myTable.Rows[0].Cells[0].Content = "Hello"; myTable.Rows[0].Cells[1].Content = Field("FName"); myTable.Rows[0].Cells[2].Content = "Goodbye"; myTable.Rows[0].Cells[3].Content = Field("LName"); myTable.Rows[1].Cells[0].Font="Arial"; myTable.Rows[1].Cells[0].TextColor="Blue"; myTable.Rows[1].Cells[0].SetBorders("Thin", "Black", "Top", "Bottom", "Right", "Left"); myTable.Rows[1].CopyCells(0, 1,2,3); myTable.Rows[1].SetContents( "Hola", Field("FName"), "Adios", Field("LName")); myTable.Rows[2].Cells[0].Font="Times New Roman"; myTable.Rows[2].Cells[0].TextColor="Green"; myTable.Rows[2].Cells[0].SetBorders("Thin", "Black", "Top", "Bottom", "Right", "Left"); myTable.Rows[2].CopyCells(0, 1,2,3); myTable.Rows[2].SetContents( "This", "Row", "is", "Green"); return myTable.MakeTags(); http://forums.printable.com/attachment.php?attachmentid=417&stc=1&d=1301344348 PDF version of this document
  18. Because you're bringing in the page of the external PDF as an inline graphic in a text frame, so it has to basically be typeset like a really large text character. So the text frame has to be slightly larger than the text. Note that the text frame is actually larger than the body page itself, so the output is still 8.5 by 11 inches. I think that's just a glitch in the sample. It can be set to zero and the job will work just fine. I think that's just a matter of getting the printer driver or Distiller settings right. Feel free to send the files to Support for analysis.
  19. In the Variable Text Editor, select all of the text in the flow, then check "Paragraph..." and set Widows to 99 lines.
  20. Yes, you'll have to take the code from the example I posted: var table = new FPTable; table.AddColumns(FirstColumnWidth, GutterWidth, FrameWidth - GutterWidth - FirstColumnWidth); table.AddRows(1); And port it to output the table tags directly, like so: var table = '<table columns=3>'; table += '<column width=' + FirstColumnWidth + '>'; table += '<column width=' + GutterWidth + '>'; table += '<column width=' + (FrameWidth - GutterWidth - FirstColumnWidth) + '>'; And so on. Or you'll need to update to FusionPro 7 to use the FPTable object.
  21. Oh, you're using version 6. The FPTable object is new in FusionPro 7.0. For earlier versions of FusionPro, this can done by outputting the table tags directly. Please refer to the Tags Reference Guide.
  22. Replace instances of Field in your rules with TaggedDataField, and remove the calls to NormalizeEntities. Leave the "Treat returned strings as tagged text" box checked (on). Note that this is a new feature in FusionPro 7.1, and is supported on MarcomCentral.
  23. No, FusionPro always generates the images as RGB JPEGs. We're looking at adding an enhancement to specify the output format and color space in a future release.
  24. You're right, that dash character is supposed to be included. I'm not sure of the historical reasons for making that substitution. You can always replace that "/M" with the dash in your code, for instance: return Make39Barcode("035S1P-RQ1 NJ758").replace(/\/M/g,'-');
  25. Code 39 is a limited encoding font, so substitutions are required: http://en.wikipedia.org/wiki/Code_39 You need to set your scanner to account for these.
×
×
  • Create New...