DrawRotatedText feature not working on certain PDFS

Discussions about PDF management.
Post Reply
rclendenon
Posts: 18
Joined: Tue Mar 20, 2012 4:36 pm

DrawRotatedText feature not working on certain PDFS

Post by rclendenon » Wed Jun 13, 2012 2:53 pm

Sorry for the re-post but I am desperate for a solution. I have submitted a ticket to technical support but have received no response. I have several pdfs that the DrawRotatedText feature of the gdPicture PDF plugin is not working. It appears to work, I get no error codes, but the text is not displayed. Below is the code I am using and attached is a zip file containing a pdf where the code works and one where it does not.

Visual FoxPro 9

Code: Select all

*Set up contants
    #DEFINE PdfOriginBottomLeft         0
    #DEFINE PdfOriginTopLeft         1
    #DEFINE PdfOriginTopRight         2
    #DEFINE PdfOriginBottomRight      3
    #DEFINE PdfTextModeFill            0
    #DEFINE PdfTextModeStroke         1
    #DEFINE PdfTextModeFillStroke      2
    #DEFINE PdfTextModeInvisible       3
    #DEFINE PdfTextModeFillPath         4
    #DEFINE PdfTextModeOutlinePath      5
    #DEFINE PdfTextModeFillStrokePath   6
    #DEFINE PdfTextClipPath            7
    #DEFINE PdfMeasurementUnitPoint    0
    #DEFINE PdfMeasurementUnitMillitmeter   1
    #DEFINE PdfMeasurementUnitCentimeter   2
    #DEFINE PdfMeasurementUnitInch         3


    *Create GdPicture Object
    oGdPDF = CREATEOBJECT('GdPicture.GdPicturePDF')

    *Apply GdPicture Licenses
    oLicense = CREATEOBJECT('GdPicture.LicenseManager')
    oLicense.RegisterKEY('XXXXXXXXXXXXXXXXXXXXXXXXX') &&GdPicture Plugin
    oLicense.RegisterKEY('XXXXXXXXXXXXXXXXXXXXXXXXX') &&Manage PDF Plugin


    *Load file
    nResult = oGdPDF.LoadFromFile('c:\test.pdf',.T.) &&.T. loads into memory, allows saving to same name
    IF nResult > 0
       MESSAGEBOX('Error loading file.' + CHR(13)+'Error Code: ' + TRANSFORM(nResult),0+16,'Drawing Date Stamping')
       RETURN .F.
    ENDIF

    *Set stamp properties
    oGdPDF.SetOrigin(PdfOriginBottomRight)  && X,Y origin
    oGdPDF.SetTextMode(PdfTextModeFill)
    oGdPDF.SetMeasurementUnit(PdfMeasurementUnitPoint)
    cFont = oGdPDf.AddTrueTypeFont("Arial",.T.,.F.,.F.)

    *Get page count
    nPageCount = oGdPDF.GetPageCount

    LOCAL i
    *Cycle through pages
    FOR i = 1 TO nPageCount
       *Select Page
       oGdPdf.SelectPage(i)

       *Add Date Stamp
         *Set Font Size
       nFontSize = 13.5 &&Sets font size to approximately 3/16"
       oGdPDF.SetTextSize(nFontSize)
        *Set Font color
       oGdPDF.SetFillColor_2(255,0,0)  &&Sets text color to red

        *Assign date to variable
       cStamp = 'June 6, 2012'

        *Add Date Stamp
       oGdPDF.DrawRotatedText(cFont,9,36,cStamp,90)
    ENDFOR

    *Save File
    nResult = oGdPDF.SaveToFile('c:\test_output.pdf')

    IF nResult > 0
       MESSAGEBOX('Error saving file.' + CHR(13)+'Error Code: ' + TRANSFORM(nResult),0+16,'Drawing Date Stamping')
       *Close File
       oGdPDF.CloseDocument()
       RETURN .F.
    ENDIF   

    *Close File
    oGdPDF.CloseDocument()

    *Release  GdPicture Objects
    RELEASE oGdPDF,oLicense
Any help would be greatly appreciated.

Russell
Attachments
PDF Files.zip
(1.49 MiB) Downloaded 300 times

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: DrawRotatedText feature not working on certain PDFS

Post by Loïc » Wed Jun 13, 2012 3:03 pm

Russell please do dot duplicate ticket on both forum and on the helpdesk. You've created 3 requests for the same problem. This is really annoying for us...
I already provided a reply on the helpdesk some days ago with a solution.
A call to ResetGraphicsState() after Having selected the PDF page solve the problem.

rclendenon
Posts: 18
Joined: Tue Mar 20, 2012 4:36 pm

Re: DrawRotatedText feature not working on certain PDFS

Post by rclendenon » Wed Jun 13, 2012 4:11 pm

Loic,

Sorry for any annoyance. I never received a response on the help desk ticket or I would not have re-posted. Is there somewhere on the website that I can check for reply's to help desk tickets? If you are replying via email then something is wrong because I am not receiving (i have checked blocked and spam email folders to).

Russell

rclendenon
Posts: 18
Joined: Tue Mar 20, 2012 4:36 pm

Re: DrawRotatedText feature not working on certain PDFS

Post by rclendenon » Wed Jun 13, 2012 6:21 pm

Loic,

Thanks for your help. I have solved the problem with missing emails. The spam filtering service that we use was tagging all emails from your company as spam. I have fixed and all is well. Thanks again for your help.

Russell

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: DrawRotatedText feature not working on certain PDFS

Post by Loïc » Wed Jun 13, 2012 6:32 pm

Hello,

We are aware about the spam concern. The problem come from godaddy smtp relay servers which are (temporally) black listed on spamcop.

To avoid such problem we've added a licenseManager tool available in the GdPciture package. Just run licensemanager.exe and ask for a trial key. This will automatically create and activate an access to the helpdesk located here: http://support.gdpicure.com

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest