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 > I need help - I can help
  New Posts New Posts RSS Feed - Creating a multipage pdf with long text string
  FAQ FAQ  Forum Search   Register Register  Login Login

Creating a multipage pdf with long text string

 Post Reply Post Reply
Author
Message
yapi View Drop Down
Beginner
Beginner


Joined: 09 Dec 15
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote yapi Quote  Post ReplyReply Direct Link To This Post Topic: Creating a multipage pdf with long text string
    Posted: 09 Dec 15 at 12:33AM
I am creating a pdf that among other components has very long strings that may produce text that are larger than a page. It is my understanding that if I add a text on a page, the text that will overflow will be clipped.

Is it possible to add a text on a page, so the library will split the text into pieces that fit onto multiple pages without clipping and add new pages as needed?
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 09 Dec 15 at 10:57AM
Func _QPDF_TXT_to_PDF(ByRef $oQP, $sText, $iLeftMargin = 20, $iRighMargin = 10, $iTopMargin = 10, $iBottomMargin = 10, $iTABtoSpace = 4, $sStyle = Default)

; Replace @TAB to spaces.
$sText = StringReplace($sText, @TAB, _StringRepeat(Chr(160), $iTABtoSpace))

Local $iTextWidth = $__eQPDF_A4_WidthInMM - $iLeftMargin - $iRighMargin
Local $iTextHeight = $__eQPDF_A4_HeightInMM - $iTopMargin - $iBottomMargin

If $sStyle = Default Then
Local $iIDFont = $oQP.AddTrueTypeFont('Arial {1250}', 0)
$oQP.SetOrigin($__eQPDF_SORIGIN_TopLeft);
$oQP.SetMeasurementUnits($__eQPDF_MUNITS_Milimeters)
$oQP.SetHTMLNormalFont('Default', $iIDFont)
$sStyle = 'DefaultStyle'
$oQP.SaveStyle($sStyle)
ElseIf IsString($sStyle) And StringLen($sStyle) Then
If $oQP.ApplyStyle($sStyle) = 0 Then
Return SetError($QPDF_ERR_WRONGSTYLEPARAMETER, 0, 0)
EndIf
Else
Return SetError($QPDF_ERR_WRONGSTYLEPARAMETER, 0, 0)
EndIf

Local $sOverFlowOutput = $oQP.DrawHTMLTextBox($iLeftMargin, $iTopMargin, $iTextWidth, $iTextHeight, $sText)
While $sOverFlowOutput
$oQP.NewPage()
$oQP.ApplyStyle($sStyle)
$sOverFlowOutput = $oQP.DrawHTMLTextBox($iLeftMargin, $iTopMargin, $iTextWidth, $iTextHeight, $sOverFlowOutput)
WEnd
Return SetError($QPDF_ERR_OK, 0, $oQP.PageCount())
EndFunc   ;==>_QPDF_TXT_to_PDF

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
yapi View Drop Down
Beginner
Beginner


Joined: 09 Dec 15
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote yapi Quote  Post ReplyReply Direct Link To This Post Posted: 09 Dec 15 at 5:23PM
Thank you for your quick reply. Basically you recommend to treat a string as an html string and replace special characters (like TAB) to html. What about CR,LF?  Shall I replace them as well?
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 09 Dec 15 at 7:24PM
You must try as I do not remember.
try to replace to <br>

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
pdfer View Drop Down
Beginner
Beginner


Joined: 13 Oct 15
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote pdfer Quote  Post ReplyReply Direct Link To This Post Posted: 18 Dec 15 at 3:03AM
Does this technique use the kerning tables in the selected font, or just the left and right bearings of the glyph?
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 18 Dec 15 at 8:02AM
Really I do not know what you mean.
Maybe some other member will be able to answer to your question.
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
 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