[Logo] Forums for GrailsFlow, Weceem, XSLfast
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Messages posted by: Victor Krapivin
Forum Index » Profile for Victor Krapivin » Messages posted by Victor Krapivin
Author Message
Sorry, I'm unsure i understand the exact roots of the problem you reported.

Let me explain a bit how XSLast works, during generating preview.

First, XSLfast checks if specified file name is being used: it tries to delete old PDF file. If deletion is failed, it seems it being used by other process, and XSLfast tries to make file <name>-1.PDF, <name>-2.PDF, and so on, unless it finds unused name. Once PDF name is determined, it calls AHFormatter, as described:



and waits until AHFormatter finished. If any warnings processed by AHFormatter, it collected into xslfast.log file for further reading. Once PDF is created, and preview requested, XSLfast launches Acrobat Reader (or any other PDF viewer you chosen), with PDF name specified for AHFormatter.

The same approach is applied to XEP and FOP, with only difference to methods of spawning FOP/XEP and passing parameters to it.

So, all you need - just check option at Layout->Layout settings dialog.

At practice, we know one issue. If such file named Demo.pdf is opened by Adobe Acrobat Reader, the adobe reader will decline any other attempts to open the same file for viewing again. The only one solution is close acrobat reader and try again.

The all steps related to preview and PDF generation, is added to xslfast.log file, so can you send this file to us?

Thank you.
Can you send us your layout and corresponding XML file (and external templates, images, etc if exists) to us?

Please send it to support@xslfast.com or to me directly: VKrapivin@jcatalog.com

Thank you.
Please check you've specified in options the AHFCmd.exe but not AHFormatter.exe, it is important point. XSLfast expecting AHFCmd.exe to be used.
Please do the following:

1. If you want to type current date in existing text, please open it. If not, please create new one.

2. For selected text, open text editor (double click). Now, please move text caret to place you want to, and type two figure braces: It means you've placed empty variable inside static text, and now you need to place such expression inside.

3. Now, move text caret inside braces, to enable tool bar at the right of the text editor (e.g. buttons String, Today, etc). Click on Today and choose Now from pull-down menu (or yesterday / tomorrow if it more suitable). It will type proper function call inside your variable, as follows: This text is editable so you can add more functions from menu, by selecting fragment of the expression and clicking to tool bar at the right side.

For example, this expression means only day of month:

4. If you need to change default text formatting of this variable, please do the following:

  • Right click on variable, then select Convert -> Date/Time menu point. It informs XSLfast to use this variable as date/time.

  • Right click again, and now follow to menu point Properties. In the inspector window, please click on 'Format' text.

  • You'll see window with date/time formatting details. Here you can specify in which form and in which separators your date/time will be set.

  • Yes, it supported.

    You should go to XSLfast preferences -> External tools and specify the path to command line Antenna House Formatter's executable file in the field "XSLFormatter path".

    AHFormatter is the new name formerly known as XSLFormatter prior to version 5.1.

    Once you specified this, you can switch your layout to XSLFormatter (AHFormatter) at Layout -> Layout options dialog, to use advanced features of AHFormatter visually.
    Please check if your table has enough space to show all rows, by increasing table frame.

    Practically, elements with relative placement have no exact sizes and positions; it handled in order as it shown on screen (left-right, then top-bottom). The exact positions and sizes are computed automatically depending on content.

    For absolute placement, it works different: the sizes and positions are used as you specified, without correction.

    What it means?

    If you'll place table template on page, it usually have limited height to table row sub-template. When you switching table to absolute positioning, the current table frame sizes become the full table sizes. As result, your table looks like one row table, because all other rows aren't fit into sizes you have.
    We're sorry IF clause for pages will be available only in next version. But anyway, you can genrate certain pages or not via groupings.

    For example, your title page have grouping



    So, by adding expression we can manage amount of pages: 0, 1 or more.

    For example, grouping (Page grouping -> Filtering tab) like this provides generation of 0 pages or more depending on 'GenerateTitle' node contents.



    By replacing this to your real expression, you can generate title page or not.
    Sorry, if you want to place 1-column output and 2-column output at one page, this option is not possible due to XSL-FO restrictions. You can either place every article on separate page sequence, or reorder your data to place on two page sequences.

    I've added your proposition n our road-map to XSLfast 4.1: http://jira.jcatalog.com/browse/XSL-1568
    It seems your text has column break. Can you send us your layout?
    I'm sorry but output for 1 column and output for 2 columns are attributes of page sequences, so you can't simply make mixed output for pages with difernt columns. But you can all time make output for 2-column pages first, by specifying proper groupings.

    For example, you have the following XML:



    So, you can define two virtual groupings for this case:



    and



    Now, we ready to make two page sequences: Page1 and Page2.

    At Page1 we defining two-columns output, for page 2 - one column output.

    Now, we ready to fill every page with contents, for example as follows:

    1. Define a table (1 column, 1 row).
    2. Assign proper grouping to table (right click->add table grouping), like article[@type='two-columns']
    3. Place contents in table cell (for your case it will be '.')
    4. Repeat steps 1-3 for 2nd page, but use other grouping to it.

    As result, you have XSL that makes report in XSL-FO for your XML structure, without dependency how much articles inside, and shows at first couple of pages articles in two columns, and the rest couple of pages contains articles dedicated for one-column output.

    Of course this way is available for XSLfast 3.1 or later.
    Please try place your contents into table rows, and specify 'keep with next column' flags for very problematic line.
    The possible way is to make two groupings - one with short chapters and second with long ones.

    In this case, you can simply add yet another page sequence (Page->Insert->Add main page)

    For every page (named main in tab) you need to

    - specify proper grouping you need (for short stories or for long stories)
    - specify amount of columns (2 or 1 respectively).

    For this case, you'll have pages with short articles first and in 2-column layout, and the pages with one column and long articles at the rest.

    If you've using XSLfast prior to 3.1, you can do the same via MultiLayout manager, as follows:

    1. Define main page, with XML you need. It will have only multi-layout information, so don't worry about contents.

    2. Define layout with first page sequence: attach the same XML as for p1, define virtual grouping as noted above, and assign it to page (or to table if you prefer table-oriented output). Specify two columns per page, and arrange content as you need.

    3. In the same manner, define second page in separate layout: the same XML, the same virtual groupings, but one column output.

    4. Return to master layout from p1. In MultiLayout manager, add both layouts via drag and drop, and specify to it the same expression (1)

    5. Assign to every added page its' own unique group.

    6. Now you can generate PDF file. If you need XSL file too, please follow to Page -> Layout settings and take a look where it will be generated, and copy the file to place you need.

    Note: for 2nd way, you need always use MultiLayout manager to generate PDF files.
    To specify custom filtering, you need to:

    1. At proper row, right click -> context menu -> add/edit break level.
    2. At opened dialog, follow to 2nd tab, and in expression window, specify data you need (e.g. Costs/*).
    3. Press [Add] button.



    Now, you have custom virtual grouping assigned to selected row and the rest rows till end of table. Of course, you can use newly created filtering for whole table grouping or even for page grouping as well, like the following image:



    Also, to let you manage sub-elements of virtual grouping (filtering) easy, you can do the following:

    Drop Costs/Deliverycosts (or any other leaf you want) into edit box "Copy from", and check option [x] Copy subtree. With this trick, you'll specify XSLfast which leafs will be shown at main tree as children leafs for drag and drop. Usually, you don't need to do this manually, and XSLfast able to compute this information on the fly. But for your case XSLfast needs an hint.

    For version 1.3 and multi-layout - you have only one way, sorry.

    You need to follow layout preferences dialog (Layout/Layout preferences menu), and specify XSL file to be used directly in dialog.

    Once you did this, open Multi-Layout Manager again, and generate PDF. The XSL (and XSL-FO) file will be generated at place you specified.

    For modern versions (3.1 and 4.0) please use File -> Export menu as usual.
    In latest versions (3.1 and 4.0), you can use regions.

    To do this, please use regions, as follows:

    1. To your layout, add first and rest regions:

    Right click on page -> Insert page -> Region first
    Right click on page -> Insert page -> Region rest


    Visually, you'll see three pages:

    a) your page, with grayed region spaces
    b) two new pages, with grayed body space.

    With mouse, you can drag wires displaying regions, to extend it as you need.

    Now, you need to move all region specific elements into newly added pages, at non-grayed space (including headers and footers), and arrange as you need.

    That's all - you made custom headers and footers for first page and for other pages.

    In the same way you can manage even/odd regions too.

    In the ancient version 1.3, the idea is the same but it is much complex to do; here you need multi-layout manager, as follows:

    0. Make new clean layout and attach correct XML to it. We'll not do anything with pages; it is just main holder for regions we'll use. Name it foo_main.lay.
    1. Update your layout: it should contain the page flow you need to fill with data, without headers and footers. Name it foo_body.lay
    2. Make new layout, and place all headers and footers related to first page. Name it foo_first.lay
    3. Make new layout, and place all headers and footers related to other pages. Name it foo_rest.lay

    Important: be sure all your layouts uses the same XML!

    Now, open again layout foo_main, and follow to Multi-Layout Manager.

    Here, with drag and drop from right top list box, add all your other layouts (foo_body, foo_first and foo_last) into left top list box. Do not add foo_main itself here!

    Now we almost there. But we need to combine layouts in dialog.

    So, check the expression is '1', and specify for all layouts the same group name (at left top list, select layout and fill form data below lists, for each from list). But please keep check boxes at the bottom unchecked. This trick informs XSLfast all 3 layouts are related to one group (flow). And now you can choose check boxes at the bottom of form, as follows:

    1. Select foo_body. Check box is [x] body
    2. Select foo_first. Selections are [x] even/odd/first/rest, in radio group (x) first/rest, in combo box - first
    3. Select foo_first. Selections are [x] even/odd/first/rest, in radio group (x) first/rest, in combo box - rest

    Now you can generate PDF.

    Note for ancient version 1.3: multi-layouts are supported only from multi-layout manager. So, if you'll use usual PDF generation in XSLfast 1.3, you'll get blank page. For versions 3.0 and above, you need to use one unified way to generate PDF files / Export XSL / XSL-FO: generate button at tool bar / menu point.
     
    Forum Index » Profile for Victor Krapivin » Messages posted by Victor Krapivin
    Go to:   
    Powered by JForum 2.1.8 © JForum Team