Print Page | Close Window

Page fills in reverse order

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1128
Printed Date: 12 Dec 25 at 10:19AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Page fills in reverse order
Posted By: danz26
Subject: Page fills in reverse order
Date Posted: 02 Jul 09 at 12:34AM
I am looping through the ascii file and adding each line of it to a pdf file using QuickPDFDrawText.  However it takes line 1 of the ascii file and starts at the bottom of the page and fills the page up.  So on each page the header is on the bottom and page number is on the top.  If I select the text and do a copy and paste of say page 1 and paste it into word.  It flips it around correctly.  Here is the code (sorry it is clarion, but hopefully you can follow it.)
 
    InstanceID = QuickPDFCreateLibrary();
    if (QuickPDFUnlockKey(InstanceID, regkey) = 1)
        do buildreport
        a# = QuickPDFSaveToFile(InstanceID, pdffilename)
    .
     QuickPDFReleaseLibrary(InstanceID)
 
buildreport routine
      QuickPDFAddStandardFont(InstanceID, 0)
      QuickPDFSelectFont(InstanceID, 0)
      QuickPDFSetTextSize(InstanceID, 12)
      QuickPDFSetTextAlign(InstanceID, 4)
     p# = 1
     pg# = 0
     ypos = 100
     AsciiName  ='ucs-report.out'
     open(asciifile)
     set(asciifile)
     loop
        next(asciifile)
        if error() then break.
        if p# > 64
           p# = 0
           ypos = 100
           QuickPDFNewPage(InstanceID)
           QuickPDFSetTextSize(InstanceID, 12)
           pg# += 1
        .
        p# += 1
        mytext = mem:asciiline
        a# = QuickPDFDrawText(InstanceID, 10, ypos, mytext)
        ypos += 10
       
     .
    close(asciifile)



Replies:
Posted By: Ingo
Date Posted: 02 Jul 09 at 6:10AM
Hi Danz!
 
In pdf-standard the bottom of a page is the low one (it starts from below). The top of the page is high. If you want to change this QuickPDF offers the function SetOrigin.
 
SetOrigin(0) is standard and means "bottom, left".
1 = top, left
2 = top, right
3 = bottom, right
 
Cheers and welcome here,
Ingo
 
 


Posted By: danz26
Date Posted: 02 Jul 09 at 6:07PM
That did the trick.
 
Thanks,
Dan



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk