Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > General Discussion
  New Posts New Posts RSS Feed - page 1342 of 5200
  FAQ FAQ  Forum Search   Register Register  Login Login

page 1342 of 5200

 Post Reply Post Reply
Author
Message
Necuacuam View Drop Down
Beginner
Beginner
Avatar

Joined: 11 Nov 16
Location: Spain
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Necuacuam Quote  Post ReplyReply Direct Link To This Post Topic: page 1342 of 5200
    Posted: 11 Nov 16 at 9:00AM
Hi! Tongue

I need to create PDF files on the fly. When the process is started I don't know how many pages the file will have. Nevertheless, I need to inform the amount of pages at the page foot (e.g. "page 1342 of 5200").

I tried to use the ReplaceTag command replacing a string like #ReplaceWithPageCount with the sum of the file pages. This method fails when the tag was written with a non-standard font Ouch

I am sure this scenario is not quite odd and I would like to know possible solutions for this problem.

Best regards Sleepy


Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 453
Post Options Post Options   Thanks (1) Thanks(1)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 11 Nov 16 at 10:11AM
First generate entire document.
Second add page numbering.

This is what I make for my self:
; #FUNCTION# ====================================================================================================================
; Name ..........: _QPDF_PageEnumerator
; Description ...:
; Syntax ........: _QPDF_PageEnumerator(Byref $oQP[, $sFormat = 'Page: %d of %d'])
; Parameters ....: $oQP                 - [in/out] an object.
;                  $sFormat             - [optional] a string value. Default is 'Page: %d of %d'.
; Return values .: None
; Author ........: mLipok
; Modified ......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func _QPDF_PageEnumerator(ByRef $oQP, $sFormat = 'Page: %d of %d')
Local $iX = 0
Local $iY = $__eQPDF_A4_HeightInMM - 20

Local $iCounter = $oQP.PageCount()
Local $sText = ''
Local $iTextWidth = 0

For $iPage = 1 To $iCounter
$oQP.SelectPage($iPage)
$oQP.SetOrigin($__eQPDF_SORIGIN_TopLeft) ;
$oQP.SetMeasurementUnits($__eQPDF_MUNITS_Milimeters)
$sText = StringFormat($sFormat, $iPage, $iCounter)
$oQP.SetTextSize(5)
$iTextWidth = $oQP.GetTextWidth($sText)
$iX = $__eQPDF_A4_WidthInMM - $iTextWidth - 10
$oQP.DrawText($iX, $iY, $sText)
Next

EndFunc    ;==>_QPDF_PageEnumerator
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600
Back to Top
Necuacuam View Drop Down
Beginner
Beginner
Avatar

Joined: 11 Nov 16
Location: Spain
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Necuacuam Quote  Post ReplyReply Direct Link To This Post Posted: 11 Nov 16 at 10:46AM
Quite simple. Great solution. Clap

Thank you mLipok 

Best regards Sleepy
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store