Page 1 of 1

Documentation on Footer options

Posted: Fri Apr 20, 2012 2:59 pm
by David_Carle
I'm amending some legacy Delphi 6 code and only have the existing code to work on, eg
Option['HeadersFooters.Footer.Right.Value']

Is there a developer's guide that lists all of the options for Footers?
If so can you send it to me, or provide a link where I can download it?

Also, can you give me some advice about the following:
1. Can one have multi-line footers? If so, how?
2. Can one have footers across the full width of the document?
3. Is there a way to specify a different footer for the final page?

Thanks

Re: Documentation on Footer options

Posted: Fri Apr 20, 2012 4:23 pm
by John - Tracker Supp
Hi,

Can you please advise if you are using our PDF-XChange driver API SDK or our Library (pxclib40/xcpro40) options and also are you modifying existing PDF pages or creating a new File ?

Many thanks

Re: Documentation on Footer options

Posted: Fri Apr 20, 2012 5:09 pm
by David_Carle
Hi John

The uses statement in Delphi includes PXC_40_Types, PXC_40_Const, PXCPro_40, PXCPro_40_Const,
PXCComLib_TLB, PXCPro_40_Types, PXC_40;

The software was installed from PDFSDKPRO4.exe

Hope this answers your first question.

We are combining a word document and an existing PDF into a new PDF.

Re: Documentation on Footer options

Posted: Fri Apr 20, 2012 5:56 pm
by John - Tracker Supp
This would suggest you are printing at least the Word doc via our drivers to PDF and then combining existing PDF files using our XCPRO40.dll library functionality.

In view of this - the term footers is somewhat misleading as the PDF format itself does not actually provide support for footers in the traditional sense. These are are inherited more from Word processing terminology and whilst we provide support in our drivers - in reality what is actually happening is we are using the text functionality to place text or a text watermark onto a specific location on the page and repeat this if set to do so.

Therefore my suggestion would be that that ignore the fact you require footers and look upon the actual placement of the required text simply as that - text being placed at specific co-ordinates on the page (recurring if required) either as text or a text watermark and view the section in our help manual for the XCPRO40.dll library functions for this purpose.

To also answer your original points;
1. Can one have multi-line footers? If so, how?
2. Can one have footers across the full width of the document?
3. Is there a way to specify a different footer for the final page?
If you are using the driver only;

1: Yes - just use the appropriate New line property as appropriate for your dev tool - in C++ this would be '/N'
2: Yes
3: No - you can specificy a different footer option for just the final page.

However - if you apply the text option outlined for the XCPRO40 library the answer to all 3 is yes as you are coding and can apply text anywhere on the page you require via co-ordinates and to whichever pages you specify specifically.

Hope that helps

Re: Documentation on Footer options

Posted: Fri Apr 20, 2012 6:28 pm
by David_Carle
Hi John
Yes, we do have that dll in our bin directory.

A few more questions ...
1. Is there a developer guide that covers these topics? You mention a help manual. Can you give me a link to this please?
2. Can you give me an example of the code to place text on pages 1 - X-1 and different text on page X (the last page)?

Many thanks

Re: Documentation on Footer options

Posted: Fri Apr 20, 2012 6:37 pm
by Ivan - Tracker Software
1. Is there a developer guide that covers these topics? You mention a help manual. Can you give me a link to this please?
If you have downloaded and installed SDKs you have to have manuals in the installation 'Help' folder (in PDF and/or CHM format).
2. Can you give me an example of the code to place text on pages 1 - X-1 and different text on page X (the last page)?
I'm afraid there is no one function call that makes this task in one pass (honestly, it is not so easy to implement universal DoWhatIWant function ;) ).
Some of the ways which can be used to acheive your task:

a) add two watermarks: one with text A and pages range from 1 to X-1; second - with text B and located on page X;
b) make a loop that will go through all pages of the document and place required text on them.

HTH

Re: Documentation on Footer options

Posted: Fri Apr 20, 2012 6:45 pm
by David_Carle
Just noticed your reply:
3: No - you can specificy a different footer option for just the final page.

Is this a typo, ie should it read "No - you cannot" ?

Re: Documentation on Footer options

Posted: Fri Apr 20, 2012 6:47 pm
by John - Tracker Supp
Yes sorry - my typo,

when using the driver - this is not possible.

Re: Documentation on Footer options

Posted: Fri Apr 20, 2012 7:16 pm
by David_Carle
OK Thanks.
I've now found the PDFX4DRV_API.pdf manual. Would you recommend the AddTextWatermark or is there a more suitable method?
I'm thinking I coudld use dwPlaceType = 5 and specify sRange
If so, is there a property or method that will tell me the total number of pages (as this will vary)?

By the way, that DoWhatIWant function would be a great addition to future releases! :D

Re: Documentation on Footer options

Posted: Mon Apr 23, 2012 1:36 pm
by David_Carle
I have made some progress (after wasting hours of time due to mistakes in the PDF-XChange Driver API SDK documentation) and can now use AddTextWatermark to specify text to print on pages 1 to X-1 and a separate watermark for page X.

My problem now is that it doesn't seem to recognise carriage returns in the text. I tried CR LF, CR and just LF but it each case it showed an unprintable character (eg box).

Can you confirm that AddTextWatermark supports multi-line text, and if so, what should the line separator be?

Thanks

Re: Documentation on Footer options

Posted: Mon Apr 23, 2012 3:35 pm
by John - Tracker Supp
Hi,

the line feed that will be useable will be Delphi specific - I checked Google and this appears to be what you need;

http://delphi.about.com/od/adptips2005/qt/crlf.htm

Re: Documentation on Footer options

Posted: Mon Apr 23, 2012 3:46 pm
by John - Tracker Supp
P.S.

yes - the driver does support multi line Footers

Re: Documentation on Footer options

Posted: Mon Apr 23, 2012 3:59 pm
by Ivan - Tracker Software
sample code snippet to set multi-line footer on C++:

Code: Select all

	printer->Option[L"HeadersFooters.Enabled"]		= TRUE;
	printer->Option[L"HeadersFooters.Footer.Center.Value"]		= L"Sample\nmulti-line\nfooter";

Re: Documentation on Footer options

Posted: Mon Apr 23, 2012 4:14 pm
by David_Carle
Thanks for the responses, but the question is about multi-line Text Watermarks (not multi-line footers, which I can now successfully use, apart from the limitation of not having a dwPlaceType option for 'All Except Last Page'. PS that would be a great enhancement, as would 'All Except First Page')

I have tried using #13 and #10 and also #13#10 as the separators but they don't act as line separators.

Are you saying that Text Watermarks definately support multi-line text?

Re: Documentation on Footer options

Posted: Mon Apr 23, 2012 4:28 pm
by Ivan - Tracker Software
No, watermarks don't support multi-line text. I can add it to the request list, and implement it in a future build.

Re: Documentation on Footer options

Posted: Mon Apr 23, 2012 7:08 pm
by David_Carle
Thank you. I think it would be a useful enhancement, as would the 2 additional dwPlaceType options I suggested earlier.

Alternatively (or additionally) it would be great to be able to specify a page range that is relative to the end page, eg
"-$1" = Up to last page minus 1.

For the moment, it looks like I'll have to simulate the differing footers by creating a TextBookmark per required line of text, and define the range.

Are there any issues or restrictions with having multiple (eg 20) text watermarks in a document?

Thanks

Re: Documentation on Footer options

Posted: Mon Apr 23, 2012 7:12 pm
by Ivan - Tracker Software
Are there any issues or restrictions with having multiple (eg 20) text watermarks in a document?
No, it should work without any problems

Re: Documentation on Footer options

Posted: Thu May 03, 2012 11:53 am
by David_Carle
Thanks to John, Ivan and Stefan for your help.

I have now achieved my objective of simulating variable footers by determining the number of pages with pXCp_GetPagesCount then using AddTextWatermark for each line of text to be included in the non final page 'footer'

In case anyone else is trying to do the same thing, a snippet of the Delphi code I used looked like this:

Code: Select all

liPlaceType := 5; // Range
lsPageRange := "1-" + IntToString(PageCount -1)
AddTextWatermark( lsWatermarkName, lsText, lsFontName, liFontWeight, liItalic, liOutline, liFontSize,
          liLineWidth, liTextColour, liAlign, liOffsetX, liOffsetY, liAngle,
          liOpacity, liFlags, liPlaceType, lsPageRange );

I would just like to say that if you'd been able to give me a link to an accurate developer's guide (as originally requested) then we could all have saved a lot of time. But that's another post!
https://forum.pdf-xchange.com/ ... 44&t=13428

Re: Documentation on Footer options

Posted: Thu May 03, 2012 12:12 pm
by Tracker Supp-Stefan
Hi David,

Thanks for the kind words and sharing the snippet here - hope it would be useful to others as well

We are doing all we can to keep the manuals as pinpoint as possible but we have almost 1200 pages of SDK Manuals and it's inevitable that there would be some sections that need fine tuning :)

Best,
Stefan

Re: Documentation on Footer options

Posted: Wed May 09, 2012 9:19 am
by David_Carle
Oops - just noticed a couple of typos in the sample code - it should be:

Code: Select all

liPlaceType := 5; // Range
lsPageRange := '1-' + IntToString(PageCount -1);
AddTextWatermark( lsWatermarkName, lsText, lsFontName, liFontWeight, liItalic, liOutline, liFontSize,
          liLineWidth, liTextColour, liAlign, liOffsetX, liOffsetY, liAngle,
          liOpacity, liFlags, liPlaceType, lsPageRange );

Re: Documentation on Footer options

Posted: Wed May 09, 2012 9:36 am
by Tracker Supp-Stefan
Thanks David,


Cheers,
Stefan