Jump to content

Dan Korn

Members
  • Posts

    4,884
  • Joined

  • Days Won

    17

Everything posted by Dan Korn

  1. Well, I don't know. How are you using it? You haven't posted the rule that's calling it. My guess is that your .js file is fine, but that you're not calling the function correctly in your rule, or at least not capturing its return value and using it in your rule correctly. I assume your rule would do something like this: return Presets.LBLNUM(); which would capture the return value of the function, i.e. the "LBLNMBR" field value, and return it from your rule. Or, more realistically, something like this: var lablnum = Presets.LBLNUM(); // Some code to do a calculation with lablnum and return something. //etc. If you're just doing this in your rule and nothing else: Presets.LBLNUM(); Then you're calling the Presets.LBLNUM function, but throwing away its return value, and your rule isn't returning anything. It would be the same if your rule just did this: Int(Field("LBLNMBR")) instead of this: return Int(Field("LBLNMBR")) The upshot here is that you're defining a custom function in your .js file, but you still need to call it and use the return value in a rule, which also has to return something. (Though that might not always be true, if your .js file just does something like setting a property such as FusionPro.Composition.repeatRecordCount, or something else that might be called in a context like OnRecordStart. But generally, your custom function is going to be returning a value to do something with.)
  2. If you want to test for multiple possibilities, you can do that in a loop, something like this: var x; for (var zeros = 0; zeros <= 3; zeros++) { var issueNumPadded = new Array((zeros || 0) + 1).join("0") + issueNumber; var FullResourcePath = pathName + issueNumber + "\\" + 'GH_magazine-' + issueNumPadded + ".pdf"; x = new FusionProResource(FullResourcePath, "graphic", 1); if (x.exists) break; } if (!x || !x.exists) ReportError("Graphic not found for " + issueNumber);
  3. Sorry you're having trouble. As I always say, it's difficult to analyze font problems in the context of this forum. And we don't allow proprietary fonts to be posted here. Your best bet is to contact Support, with as much information as possible, including: the exact versions of FusionPro, Acrobat, your third-party font tools, and your operating system, the relevant font file(s), and your fonts.ini, fonts.err, and fonts.update.err files (from "C:\Users\Public\Documents\PTI\FusionPro\" on Windows or "/Library/Preferences/PTI/FusionPro/" on Mac). That said, you can look in those fonts.ini, fonts.err, and fonts.update.err files for some clues about the font and how it was (or wasn't) processed by the font loader. With FP 11, you should be able to restart Acrobat to pick up any changes to the activated fonts on your system, and this should work with third-party font utilities, though we haven't tested with every font utility out there. It's possible that the font is showing up with a different name in FP 11 and 12 than in older versions. Versions of FusionPro to FP 11, especially on Mac, used older names, such as QuickDraw names, for some fonts. Also, in order to support all styles of a font family with lots of width and bold variations, some font families are broken up into multiples (whereas prior to FP11, many of those styles were not available at all in FusionPro). On Mac, you can go into the Text Editor, right-click, and select Font -> Show Fonts, and that will bring up the system font palette, where you can select fonts the "Mac" way, and see all the styles in a family, and once you select a family and typeface there, the font drop-down on the Text Editor should show you the name that FusionPro has chosen for that style.
  4. The short answer is: No, there isn't any way to pop up a window to enter values when composing in FP Creator (in Acrobat), other than the record range and other info in the Composition Settings dialog. The usual way to accomplish something like this is to put whatever data you want to have entered in the pop up into a secondary data file (XDF) instead. You mention that "Data is taken from separate excel files." That sounds like you're already using XDFs, and that you already know how to deal with them. So all you need to do is add another XDF with one record and have a rule read that and apply the data however you want. Then all you have to do before each composition is update that XDF file with whatever data you're wanting to enter into a pop-up window. The longer answer: When you say, "Before the generating the print file," you mean, "right before the composition is done." Keep in mind that FusionPro compositions do not always occur in the interactive context of the Acrobat plug-in where you're designing the template. Most compositions occur in an automated context, such as jobs submitted to FusionPro VDP Producer or Server, including to other systems utilizing FP Server, usually a web application such as MarcomCentral DM/Portal or EFI Digital StoreFront. Sometimes these apps have their own user entry forms for typing in data before a composition is run, but often the jobs are run in a truly automated way, such as on a timer or triggered by an external event, so there's no direct user interaction at all. Thus, the very concept that a user is there to type in data into a window when a composition starts is an assumption that's not always true. Therefore, at a basic level, we don't know whether a template will be composed in a manual/interactive way versus in an automated way, so we don't have any functionality that assumes one way or the other. Users who want other ways to collect data for a FusionPro composition typically do that in their own custom application which utilizes FP Server. It sounds to me like your job could benefit from that kind of Server workflow, where you have a custom application with a form of some kind that allows the user to enter a number, then when that form is filled out and the Submit button is clicked, the application triggers an event and the composition is started automatically via a call to the FusionPro Server API. You could also probably further automate such a system so that jobs get kicked off every day automatically, and the starting number for the barcodes is read from a file or database that remembers what was run previously.
  5. This functionality does work, but you have to use valid JavaScript syntax. In this case, you do indeed have an illegal character. When I copy that code into a .js file and put it in my plug-ins folder, it says the error is on line 4. The illegal characters are the curly double quotes. They're also on lines 6 and 7. These were probably put in by whatever application you were using to type in the code. (You probably want to use an actual code editing app like Xcode or Sublime Text instead of something that wants to format curly quotes like TextEdit.) You also don't want those the backslash escapes for the double-quotes. Changing those to straight double-quotes and removing the backslashes, and removing the unnecessary string parameter from your function, this works for me: Presets = new Object; Presets.LBLNUM = function() { return Int(Field("LBLNMBR")); } Presets.LBLNUM.description = "Remove Leading Zeroes from Label Number"; Presets.LBLNUM.syntax = "Presets.LBLNUM()"; I also changed the syntax to include the object name, which is needed to call it.
  6. Yes, though you can calculate it. The way the text-based barcodes work, you specify the point size, and each "letter" of the encoded barcode is output as a glyph (character) in the barcode font, in this case the IDAutomationDMatrix font. Each glyph in the font represents four dots (pixels) in the barcode, so each dot will be one-fourth of the point size. So if you want the total height of 16 pixels, which is four lines of characters in the font, to be 8.128 mm, which is 0.32 inches, or 23 points, then we can just divide that 23 points by the four lines of text, to give us a point size of 5.75 points.
  7. The issue is that there's too much data (and the wrong kind of data) for a 16x48 barcode. Your sample data is a mix of digits, upper-case letters, and lower-case letters. The IDAutomation spec says that the C40 encoding mode is "used to encode data that primarily consists of numeric and upper case characters", and that TEXT mode is for numbers and lower-case letters. It also says that the capacity for format 29 (16x48) is 72 alphanumeric characters, but the letters have to all be upper- or lower-case, depending on the encoding mode. And, in fact, if I convert the rule to JavaScript and add this line: DataToEncode = ToUpper(DataToEncode); Then the barcode does appear as 16 x 48. With the original data, it's too much to encode as 16x48, so it uses another mode, something like 32x32, instead. Keep in mind that the format you're specifying is a preferred format, i.e. a minimum size, and that the barcode can get larger than that preferred size as necessary to encode the data. Regarding the ECC200 error correction, that's always used by DataMatrix barcodes, at least with our encoder.
  8. A barcode with no data is still valid. If you want nothing to appear when the data field is empty, put this before the return line: if (!DataToEncode) return NullResource();
  9. Thanks for the update. In the future, instead of manually deleting fonts.ini, you can go into the FusionPro app, from the Server menu, and select Reset Fonts.
  10. Hmm, not sure why you're not seeing the embedded image, but you should be able to see the link to the attachment, right at the end of my post. Here's the link again: http://forums.pti.com/attachment.php?attachmentid=2174&d=1654194040 Sure, exactly the same way you attached the picture in your previous post.
  11. Thanks. Okay, so that makes it simpler. Well, without seeing your job and the data file, it's hard to suggest a specific rule to write. But you don't need any JavaScript at all to accomplish this. You can make a series of Drag-and-Drop Wizard rules to pull in one of two graphics, depending on whether the value in the data for each field is zero or not, something like this: http://forums.pti.com/attachment.php?attachmentid=2174&stc=1&d=1654194040 Or you could make a Switch Wizard rule, similarly doing a numeric comparison and returning one graphic for the case of a zero value and another by default. Also, you're not really still on FusionPro version 7.2 like your profile says, are you? You might want to update that.
  12. As I noted in my previous post, it's in "/Library/Preferences/PTI/FusionPro", like always. What changed in FP 11 is that you don't need to load fonts anymore; new fonts get loaded automatically when Acrobat starts. But the fonts.ini still keeps track of them. Well, FusionPro doesn't think there's a non-italic style loaded, even if you (think you) have those styles installed. So those two styles show up as non-Italic in the Font Book app? Can you see the styles in another app, like Text Edit? Maybe. Like I said, you could post the fonts.ini file here. But you can't post font files here. So it's all trying to look at your system through a keyhole. Support can set up a remote session to look at your computer if needed.
  13. It's just a warning message, not an error. Is the output right? If so, you can ignore the message. But Fellsway is right. You can't do an "infinite" stack of all records in the job if you're breaking the stack every time a new chunk (output file) is opened. Set the stack number to correspond to the chunking and the message will go away (though the output should be the same). Susan also is right. If you want the chunking (number of records in each output file) to take precedence over the stacking (number of records in each stack), you can set that in OnJobStart. That will also make the message go away, but you're still not really doing "infinite" stacking, because the stacks are still broken up each time a new output file is created.
  14. I think you want two different graphics, one that's the empty box with rounded corners, and another that's the box with the check. I would just make some graphic frames, and use rules to assign one of the two pictures to each. You could also make an empty frame with a rounded border, and then (probably in a separate frame) either put the check mark graphic, or just nothing. As for the layout, I don't know how much variability there is. Are there always going to be the same four boxes (2022, 2021, 2020, and 2019), or can there be a variable number of them? If it's always the same number, then you could just make four graphic frames, with a rule for each one. If the number is going to be variable, you could make a repeatable component with a graphic frame and a text frame, and put down as many of those as you need. Or you could make a table...
  15. It seems that FusionPro thinks you have only one style of the Gotham font loaded. It's almost impossible to diagnose problems like this in the context of this forum, as there's no way to determine what the cause is without more information, possibly an examination of the fonts installed on your system. That's why my signature says to address any font issues to Support. That said, you could look in the files fonts.ini, fonts.err, and fonts.update.err, in the folder "/Library/Preferences/PTI/FusionPro". The fonts.ini file will list which fonts are loaded, and the .err files will have some information about how the fonts ended up grouped the way they are. You could attach those files (though not the actual font files) here, but again, as my signature notes, I won't really be able to look at them unless you go through Support. You could also look at the Font Book app to see which styles of the Gotham font are installed and activated on your system. If you do install any new fonts, you'll need to quit and restart Acrobat in order for FusionPro to pick them up.
  16. Hello FusionPro Clients, On Saturday, June 4th, 2022, we will be migrating our primary datacenter to Switch in Las Vegas - one of the premier facilities in the world. This will provide MarcomCentral and FusionPro systems with increased resilience and uptime. All users of previously-installed FusionPro software will not be affected. However, the licensing server will experience downtime on Saturday, June 4th (likely during California business hours). If you are installing or migrating FusionPro on June 4th, the software will not be able to register during that downtime. You will have to complete the registration at a later time. Thank you for using FusionPro and let us know if we can answer any questions. Regards, FusionPro Team
  17. This will be fixed in an upcoming release, likely 12.1.4, though I don't have a release date to share yet. Please contact Support if you need access to pre-release builds.
  18. Do you mean issues accessing the file path, like a permission/sharing issue? Or do you mean issues specifying the path in a rule? The best way to resolve that is to put the path to the server in the Search Path box on the Advanced tab of the Composition Settings dialog. If the file is on a network drive, you probably need to use a mounted drive spec on Mac, starting with something line "smb://". If you're submitting the job from Mac to Producer, you may need to specify two different paths in the Search Path box, delimited by a semicolon: a mounted drive spec for Mac and a UNC path for Windows. Or put the UNC path to the graphics in the search path for the queue, in the Producer Configuration app. Sure, although you need to be able to find the graphic resource either way.
  19. Either should work. If it's an image, you probably want an inline graphic (refer to the User Guide). If you click the "Go Advanced" button under the area where you type in your message, there will be a "Manage Attachments" button. You can attach the graphic to the post that way. (If you want to get extra fancy, after uploading the attachment, you can hover over the name to get a link to show it in the post.)
  20. I wouldn't approach the job that way, creating all those body pages in the template. Instead, I would either use an overflow page with inline graphics, per this thread: http://forums.pti.com/showthread.php?t=37 Or, even simpler, just make a simple one-page template, with a graphic frame, and repeat the record for the number of pages in the PDF resource, with code like this in OnRecordStart: var PDF = Resource(Field("ARTF"), "graphic"); FusionPro.Composition.repeatRecordCount = PDF.countPages; PDF.pagenumber = FusionPro.Composition.repeatRecordNumber; FindGraphicFrame("FrameName").SetGraphic(PDF);
  21. Okay. Well, it's still impossible for me to know what's going on without seeing your job files. Does the problem occur with just that one job? You could attach it, or at least an example that shows the problem. Or does it happen with all jobs? Is the problem only in Preview, or does it affect composed output as well? Do you mean charts or tables? There's more info on both in the documentation. This means it's the multi-line records from the primary data source. In the Data Source Wizard, on the tab where the Excel file is specified, there's a check box "Multi-line records" which is checked, and clicking Next takes you to a screen where you can specify when the primary record changes. This is also documented. The Form table rules allow you to specify either the multi-line records, or a mapped secondary data source, for the table data. Well, there's information in the doc (the User Guide and the Rules Guide) about some of these features.
  22. It's hard to say why that's happening just from the picture. It's possible that the page's trim box was changed after those frames were put down. At any rate, nudging the frame just a bit (with the arrow keys) should fix it. Also, you might consider creating the entire table with FusionPro. You can use Form rules in FP 11 and later to build tables without any JavaScript code.
  23. I can confirm this is a (very old) bug. The PDF Document info doesn't get written properly to the output file if the first page of the template is set to unused. I've entered case FP-582 about this. We're looking at a fix for an upcoming version. I don't know of any workaround, other than to set a "dummy" first page in the PDF template which is always output. (It could just say something like "This page intentionally left blank.")
  24. I think the problem is on the first line of your rule: onlinePreviewVal = FusionPro.Composition.JobOptions.IsOnlinePreview; It should be: onlinePreviewVal = FusionPro.Composition.JobOptions.isOnlinePreview; Note the lower-case "i" at the start of the property name isOnlinePreview. Or better yet, remove that line completely and make the next line this: if (IsOnlinePreview()) While CFG settings are case-insensitive, JavaScript properties, such as of the FusionPro.Composition.JobOptions object, are named case-sensitively, so upper-case vs. lower-case is significant. Calling the built-in global function IsOnlinePreview() instead is better, as it insulates you from having to know the internals of the CFG file and its settings and values.
  25. So, there are some improvements to copyfitting coming in a future release, which might help with a case like this. For now, probably the simplest thing to do would be to just do a bit of math to set the width attribute of each <graphic> tag, dividing the total width of the frame by the number of graphics. That will probably work for most cases. That said, I would approach this differently, and not use inline graphics at all. Especially since the graphics, as you say, are going into a fixed space on the page. Inline graphics are meant to be, well, inline with text, i.e. flowing with it. Yes, you're trying to kind of "flow" multiple graphics and size them as a group, but I think there's a better approach. My idea is to use a set of graphic frames, and have some kind of logic to swap out the number and sizes of the frames based on the number of graphics to show. I can think of several different ways to accomplish this (in order from probably easiest to hardest): Have a series of 9 named graphic frames on the page, and dynamically set their sizes and hide the unneeded ones as appropriate. (Similar to the approach above with the inline graphics, but you have more control over the scaling and position of each graphic in its resized frame.) In FusionPro 11 and later, set up multiple groups of graphic frames, one group for each number of frames, all hidden, and show the appropriate one. Create a series of Repeatable Component (Template) pages, all at the size of the entire area for the graphics on the main page, with different numbers of graphic frames laid out. Then you can have a rule which selectively calls out one of those Repeatable Components based on the number of graphics.
×
×
  • Create New...