Jump to content

Dan Korn

Members
  • Posts

    4,884
  • Joined

  • Days Won

    17

Everything posted by Dan Korn

  1. Sorry for yet another follow-up, but after thinking about this a little more, it seems simpler and more reliable to just use the full path of the actual graphic file in a CreateResource call, like so: return CreateResource(Field("Logo"));This will guarantee that the exact graphic file corresponding to the selection in the image drop-down menu in MarcomCentral will be used in the output. You don't even need to add any Resources to the job at all. This will work under FP Desktop as well, as long as you put the actual filenames (with extensions) in your input data file. Also for Desktop, if the graphic files are not in the same folder as the PDF template, you can either write the full paths to the data file, or you can set the Search Path in the Composition Settings dialog, Advanced tab.
  2. Sorry, my last post was incomplete. Under MarcomCentral, with a Graphic field, you do still need to match just the file name of the graphic, rather than the full path. If the names of the actual graphic files uploaded to MarcomCentral do not have filename extensions (e.g. "AppraisalEnv", "BankAndTrustEnv", etc., rather than "AppraisalEnv.jpg"), then you can use the logic in this post. In this case: function FileNameFromPath(fullPath) { return String(fullPath).replace(/^.*(\\|\/|\:)/, ''); } return Resource(FileNameFromPath(Field("Logo")));If the graphic files contain extensions ("AppraisalEnv.jpg" etc.), then you'll need to use this slightly different logic: function FileNameFromPath(fullPath) { return String(fullPath).replace(/^.*(\\|\/|\:)/, ''); } function RemoveFileExtension(filename) { return String(filename).replace(/\.[^\.]*$/, ''); } return Resource(RemoveFileExtension(FileNameFromPath(Field("Logo")), '')); Note that because of the way MarcomCentral writes the data file, with the full path to each graphic file, it's difficult to test this solution in FP Desktop.
  3. I don't think you need any kind of special function here. The best part of Stella's advice is this: Specifically, it seems to me that you can reduce the entire rule to this single line: return Resource(Field("Logo"));
  4. Check the box "Treat returned strings as tagged text" in the Rule Editor dialog.
  5. I don't think we have any specific plans to add the ability to output directly to other graphic formats besides JPEG. But never say never; we will give consideration to all feature and enhancement requests. The main purpose for adding this functionality, as Mark noted, is to enable online Web-to-Print systems (such as FusionPro Web) to be able to offer previews in web pages. As far as I know, there's no reason why any other graphic format would work better than JPEG for that purpose. Is there a specific reason why you need to be able to output to other formats? Again, if you have a job where this feature is not working, we definitely would like to take a look at it so that we can analyze the problem and fix it. If you could send it to Support, I would appreciate it. You can note that I asked you to send it.
  6. This example should illustrate the effect of the "accumulate" attribute: return "Accumulate off:<t><span color=Red>Hi<color name=Green> there!</span> After span<br>\n" + "Accumulate ON:<t><span color=Red accumulate=true>Hi<color name=Green> there!</span> After span";
  7. Sorry, the only image format you can output directly from FusionPro Server is JPEG. No, what the original post says is that the PDF2IMG utility can output those other formats. It doesn't say that FP Server can.
  8. Sorry about that, but there's no way to analyze the problem here in the forum without the job. I recommend sending the job to Support for analysis. If you can specify exactly which version of FusionPro Server you're using, that would be helpful as well. This feature only works with PDF output.
  9. Attached is a little sample job which shows this logic in action. One of the "portrait" frames is rotated, which basically shows how to rotate all graphics to be landscape. You can overlap the "landscape" and "portrait_rotated" frames to achieve the effect of having the graphics auto-rotated in the same location in the output.RotateGraphicExample.zip
  10. Sorry, my previous post was in response to the original poster's secondary question: Now, regarding this question: In this case, I would still use two frames, but rotate one of them with the Frame Properties palette. Ideally, both frames would exactly overlap each other, but the landscape box would be, say, 1 inch wide by 2 inches deep with zero rotation, and the portrait box would be, say, 2 inches wide by 1 inch deep and rotated 90 degrees. So any graphic returned by the rule for the portrait box would be rotated by the frame, while any graphic returned by the rule for the landscape box would be unrotated. Does that make sense?
  11. Please make a separate thread for each issue, to avoid ambiguity in follow-ups by people saying they are seeing the same issue. Which of the two issues is that? Also, if you can provide any more details about each problem, such as a screen shot or a minimal job which reproduces them, that would be helpful.
  12. You should be able to rename, move, or even delete your own threads.
  13. Thus the location of this thread under "The JavaScript Library > Formatting Text". Although technically one can use tagged markup such as this in input and resource files without JavaScript rules.
  14. The <span> tag is a powerful feature of the FusionPro VDP products suite. Unfortunately, it's currently undocumented. This post attempts to remedy that shortcoming. The <span> tag pair was designed to allow style overrides over a specific range, or span, of text. The initial, or opening, <span> tag can take several attributes, which specify style attributes to be overridden in the span. The overrides remain in effect until the ending, or closing, </span> tag is reached. The <span> tag can take any number of the following optional attributes: suppress={true|false}. Defaults to false. If true, all text within the span is suppressed. accumulate={true|false}. Defaults to false. If false, the ending </span> tag restores the style in effect at the beginning of the span. If true, the ending </span> tag restores the style, taking into account any other changes within the span. color=(color name). If present, the specified named color is applied to the entire span as an override. shading=(percentage) If present, the specified shading, or tint, percentage is applied to the entire span as an override. All colors applied to text within the span are shaded by the specified percentage. pointsize=(number). If present, the specified point size is applied to the entire span as an override. Units are in points. font=(font name). If present, the specified named font is applied to the entire span as an override. bold={true|false}. If present, the style of the entire span is set to either bold or not bold, as an override. italic={true|false}. If present, the style of the entire span is set to either italic or not italic, as an override. If the <span> tag is used without any attributes, it effectively acts as way to save the running text style and restore it when the ending </span> tag is reached. For example: <color name="Black">Hi <span><variable name="NameInColor"></span>, you're a winner!This ensures that the original running style of the text is restored, no matter what the "NameInColor" rule does, even if it changes the running color of the text using a <color> tag.
  15. Metadata can be embedded in VDX output. From the Input Options dialog (from the menu in Acrobat, FusionPro > Data Definition > Input Options), click "Edit Fields", then you can edit any field and there is a "Use as VDX metadata" check box. I'm not sure exactly how you would want metadata embedded into regular PDF output. I would need to know more about how the metadata is intended to be used to even be able to investigate how to add it. You can add keywords to the PDF output using the "Doc Info" tab on the Composition Settings dialog, but I don't think there's a way to change that programatically at composition time without access to the CFG file settings in FusionPro Server. You can also create an external XML metadata file with a composition (to any output format) with the FusionPro.Composition.CreateXMLLogFile and FusionPro.Composition.LogXMLMetadata JavaScript functions, although this is mainly used with statement-type jobs.
  16. Keep in mind that Preview is just a tool to help you in the development of your template, to facilitate things like seeing what happens when you change something small in your job. It's no substitute for the output of a full-blown composition (and ultimately, sending the output to a printer or RIP). Anything that relies upon the aggregation of, or dependencies between, multiple records simply is not applicable to Preview.
  17. Ah, I see what you're trying to do now. The problem you're running into is that Preview is a special case, where things aren't set up quite the same way as for a "regular" composition. Specifically, for Preview, the input file is not actually the file you've specified in the Data Source Wizard; instead, it's a single-record file in your temp folder, whose name is something like "124371912_IN.txt". (Preview would take a long time if it had to read in the entire input file to find just the record you're trying to see, so we auto-generate a little file with just the data for that record, which is much easier for the Preview composition to digest.) So, no, you can't really switch off of the name of that auto-generated Preview input file. I can think of a couple of alternatives. You could add a field to the input file which specifies its "purpose" (reminders vs. confirmations) and switch off of that. Or you could use a simple ExternalDataFileEx that you read in only for Preview compositions where you specify either "remind" or "confirm", and then you could modify that in an external text editing application and click Refresh on the Preview Record Selector.
  18. I don't understand. What exactly doesn't work in Preview that works otherwise? Precisely what are you trying to make "work"?
  19. That would be a question for the FP Web forum. It depends on how the data is presented to FusionPro at composition time. If you have the input file that FP Web generates, we can take a look at it and see what's in it and then figure out how to process it. It can be in any regular rule that returns its results to a text frame in your template. Again, it depends on what you're trying to do.
  20. Sure, sorting data alphabetically is absolutely possible. JavaScript is great for this kind of stuff. Exactly how is the data presented to FusionPro? Is it all in one field with some kind of intra-field delimiter? Or an external data file? Are the phone numbers already associated with the names in the data? At any rate, if you can get the data into an array, you can just use the native Array.sort method in JavaScript: https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Objects/Array/Sort Sorts are done by simple string comparison by default, so if you're simply sorting by first name, there's not much to do. (Although I'm not sure I would sort by first name in a real-world application, but that's just me.) var myArray = [ "John Smith 858-123-4567", "Adam Rodriguez 986-456-7894", "Robert Hoo 201-457-7847" ]; return myArray.sort().join("<br>\n"); Again, though, how you populate the array initially depends on how the data is being imported. If it's in an external data file, you could use ExternalDataFileEx to read it in. If it's in something like a comma-delimited list, you can use String.split to turn it into an array, for instance: var myData = "John Smith 858-123-4567,Adam Rodriguez 986-456-7894,Robert Hoo 201-457-7847"; var myArray = myData.split(","); return myArray.sort().join("<br>\n");
  21. Drop shadows are available only for text frames at this time.
  22. Sure, just prepend a <p> tag to the cell contents and set the "quad" attribute, for instance: <p quad=C> for center aligned. If you want to adjust the alignment without starting a new paragraph, you can use set the "br" attribute to false as well: <p br=false quad=R> (where "R" denotes right-aligned). Left alignment is the default for all paragraphs. See the Tags Reference Guide for more information on the<p> tag.
  23. Dan Korn

    Ligatures

    First of all, the answer to your question depends on your operating system and the version of FusionPro you're using. You need to be using FusionPro 5.8 or newer to handle Unicode (double-byte, i.e. 16-bit, i.e. > 255 or 0xFF) characters. There's no way to use such characters, either in the Variable Text Editor or in a composition, in FusionPro 5.1 or earlier. However, if you are using a Unicode-capable version of FusionPro, any 16-bit Unicode character should be accessible, although not all fonts will contain glyphs for all characters. I'm not sure what you mean by "characters that do not have alt characters." On Windows, if I'm using a Unicode-aware application, I can hold down the Alt key and type 64257 on the numeric keypad (NOT on the number keys above the QWERTY letters), and the "fi" ligature shows up, at least in most fonts. This works for any Unicode character. It definitely works for me in the Variable Text Editor in FusionPro 6.0 with in the "Arial Unicode MS" font. Keep in mind that some fonts may show a different glyph at this code point, or may not include it at all. On Windows, the Character Map (Start -> Run -> charmap) utility will show you any glyph for any Unicode character in any installed font. If you check the "Advanced view" box, you can enter a hexadecimal code in the "Go to Unicode" box. If you enter "FB01", it shows the "fi" ligature. (Yes, the Character Map wants hexadecimal and the Alt key combinations want decimal, at least on Windows XP; you can take up that issue with Microsoft.) You can also type "latin small ligature fi" (the full Unicode name of the character) in the "Search for" box to find it. Back to FusionPro, in tagged markup, you can use either "&#64257;" or "&#xFB01;" to output the "fi" ligature. Again, you have to be using FusionPro 5.8 or newer, and you have to be outputting text in a font which supports Unicode and has a glyph at that particular code point. (Also, if the job was created in an older version of FusionPro, you may need to go to the Advanced tab of the Composition Settings dialog and uncheck the "Limit processing to Latin-1 text" box.) If you think you're meeting these criteria and you're still not getting the character in your output, then check your log (.msg) file for any relevant messages.
  24. Dan Korn

    Ligatures

    If you're talking about these kinds of things: http://en.wikipedia.org/wiki/Ligature_(typography) They're just glyphs in a font like any other "letter." If the ligature you want is in the ASCII range, such as "Æ" (not sure if that will show up on all browsers), then you can use one of the standard named entities in entity.def (or entity.mac.def) such as "Æ" in tagged markup. These entities are listed in the FusionPro Tags Reference Guide. You can also type such a character directly into the Variable Text Editor (see below) in any version of FusionPro. Of course, many of the "precomposed" ligatures are in the Unicode (non-ASCII, or 16-bit) range: http://en.wikipedia.org/wiki/List_of_precomposed_Latin_characters_in_Unicode#Ligatures So, you would need to use FusionPro 5.8 or later to use them in either the Variable Text Editor or in a composition. You should be able to type (or copy-and-paste) such characters directly into the Variable Text Editor. On Windows, you can use the Character Map (Start -> Run -> charmap) to access extended Unicode characters, or use the appropriate Alt+number key combination. On Mac, you can use the Character Palette. (In OS X 10.5 [Leopard], go to System Preferences -> International -> Input Menu, click "Show input menu in menu bar", then you get a nice patriotic flag on your menu bar with a "Show Character Palette" option, from which you can insert any character directly into the Variable Text Editor. And I have to say that supporting this, along with Unicode input sources, was something for which we did a lot of work in FusionPro 5.8 for Mac.) Also in FusionPro 5.8 or later, in addition to the standard named ASCII entities, you can use numeric Unicode entities in tagged markup , such as "&#592; or "&#x0250;"
  25. You can use Text Measurement with an inline graphic to determine the graphic's dimensions, and then put the graphic into the appropriate box. I would use a function like this, in the JavaScript Globals: function IsResourceLandscape(res) { if (!res instanceof FusionProResource) throw "Not a resource: " + res; if (!res.exists) throw "Resource not found: " + res; var TM = new FusionProTextMeasure; TM.useTags = true; var err=TM.CalculateTextExtent(res.content); if (err) throw "Error measuring resource: " + res + ": " + TM.messages; Print(res + ": Width=" + TM.textWidth + ", Depth=" + TM.textHeight); return TM.textWidth > TM.textHeight; }Then you can call the function in a graphic rule for the landscape box, like so: var MyResource = Resource("MyResourceName"); // base this on a field or some other per-record data if (IsResourceLandscape(MyResource)) return MyResource; //else return NullResource();For the portrait box, just change the second line to: if ([color=Red]![/color]IsResourceLandscape(MyResource))
×
×
  • Create New...