PDF Generating Tool Support Forum

HOME   Login   Register    Search

Post a reply
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Font size:
Font colour
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are OFF
Disable BBCode
Do not automatically parse URLs
Confirmation of post
To prevent automated posts the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the Board Administrator.
Confirmation code:
Enter the code exactly as it appears. All letters are case insensitive, there is no zero.

Topic review - Conditionnal footer page number
Post subject:  Re: Conditionnal footer page number
Hmm... PD4ML cannot estimate a number of resulting PDF pages before a render() call.

I would recommend to run a first fake conversion procedure to an ignored ByteArrayOutputStream, just to let pd4ml.getLastRenderInfo() return a number of pages. After that you can make a decision either to specify a footer or not.

A feature you need requires a test conversion pass. It makes not much difference if you run it explicitly in your code, or we hide it somewhere in PD4ML logic.
    Post Posted: 19 Nov 2012, 22:21
Post subject:  Conditionnal footer page number

is it possible to add footer (with page number and total page number) only if document has more than 1 page ?

The setPagesToSkip(1) function isn't a good solution for me because it always hides page number on first page ; i need to display page number also on first page if document contains multiple pages.
The pd4ml.getLastRenderInfo(PD4Constants.PD4ML_TOTAL_PAGES) method might be the solution (in order to get document's total page number) but the renderer isn't initialised yet when defining footer. Is it possible to "prepare renderer" before generating PDF document ?

Note : I use the lastest PD4ML version (pd4ml.volume.380fx7)

    Post Posted: 14 Nov 2012, 13:21

Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share