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 - SetTextSize()
  FAQ FAQ  Forum Search   Register Register  Login Login

SetTextSize()

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


Joined: 28 Oct 08
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote harvey Quote  Post ReplyReply Direct Link To This Post Topic: SetTextSize()
    Posted: 28 Oct 08 at 1:53PM
In the following Visual FoxPro 9.x code snippet, I'm attempting to open an existing PDF document and add at the top of the page the text that reads "Text to Draw".  I'm able to do this without any problems.  The text appears but I am not able to control the text size.

All attempts to change the font size have failed.  I have tried loading other fonts (both True-Type and ATM) nad both say they load although they don't show up.  It is like the commands are being received bot the output is not rendering anything to do with font control.


oPDF=CreateObject("ised.quickpdf")
oPDF.UnlockKey("myPrivateKey")
oPDF.LoadFromFile("mydoc.pdf")
oPDF.SetOrigin(1)    && TopLeft
nFont = oPDF.AddStandardFont(8)
oPDF.SelectFont(nFont)
oPDF.SetTextSize(6)
oPDF.SelectPage(1)

oPDF.DrawText(10,10,"Text To Draw")
oPDF.SaveToFile("c:\MyNewDoc.pdf")

Any help would be greatly appreciated...

--Harvey

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 29 Oct 08 at 3:11AM
Hi Harvey,

thanks for joining here. You're welcome!
Perhaps you should change the sequence to get success...
Here an example how i'm doing it:
QP.NewPage;
QP.SetPageSize('A4')
QP.SetTextSize(10);
QP.AddStandardFont(0);
QP.DrawText(50,sh,s);

Best regards,
Ingo
 
Back to Top
harvey View Drop Down
Beginner
Beginner


Joined: 28 Oct 08
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote harvey Quote  Post ReplyReply Direct Link To This Post Posted: 29 Oct 08 at 11:43AM
Here is what I just tested.  It does not work!  The font size is not changing.  Do you think it might have to do with my running Acrobat 5 on my system?  Otherwise, I have no clue... 

The StandardFont is changing, the NewPage is being created and the file is being saved so a lot is working correctly. 

I also tested making Barcodes and that seems to be working and I can adjust the size of them.

Setting the Origin works... very strange!!

And just to rule out scope, I declared a var lnFontSize public and set it to a value of 6.  Then passed it to the SetTextSize(lnFontSize) and still no go - still does not work.

I'm working with Version 5.22

oPDF=CreateObject("ised.quickpdf")
oPDF.UnlockKey("myKey")
oPDF.NewPage()
oPDF.SetPageSize('A4')
oPDF.SetTextSize(6)
oPDF.AddStandardFont(4)
oPDF.DrawText(10,10,"Text To Draw")
oPDF.SaveToFile("c:\MyNewDoc.pdf")


Thanks for your reply.  Any other suggestions would be greatly appreciated.

--Harvey
Venice
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 30 Oct 08 at 2:32AM
Hi Harvey!

Okay... I've tried it now by myself...
It works. With my testcode you'll
create six lines with "Textsize xxx"
beginning at the top left corner.

Cheers, Ingo


The code:

         QP := TiSEDQuickPDF.Create;
         try
            QP.UnlockKey('MyRegKey...');
            QP.SetOrigin(1);
            QP.SetPageSize('A4');

            QP.AddStandardFont(1);
            QP.SelectFont(1);
            QP.SetTextSize(6);
            QP.DrawText(10,10,'Textsize 6');
            QP.SetTextSize(8);
            QP.SelectFont(4);
            QP.DrawText(10,30,'Textsize 8');
            QP.SetTextSize(10);
            QP.SelectFont(4);
            QP.DrawText(10,50,'Textsize 10');

            QP.AddStandardFont(3);
            QP.SelectFont(3);
            QP.SetTextSize(6);
            QP.DrawText(10,70,'Textsize 6');
            QP.SetTextSize(8);
            QP.SelectFont(4);
            QP.DrawText(10,90,'Textsize 8');
            QP.SetTextSize(10);
            QP.SelectFont(4);
            QP.DrawText(10,110,'Textsize 10');
            QP.SaveToFile('c:\temp\textsize.pdf');
         finally
            QP.Free;
         end;


Back to Top
harvey View Drop Down
Beginner
Beginner


Joined: 28 Oct 08
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote harvey Quote  Post ReplyReply Direct Link To This Post Posted: 30 Oct 08 at 1:25PM
I tried your example.  It does NOT work here. 

I suspect this is an incompatibility with Visual Foxpro.  I have heard of such issues before using other ActiveX products.  It has something to do with the way the tool is exposed in memory so say some of the FoxPro message boards.  I don't know more details.

But thank you very much for your efforts.  At this point I'm going to try Amuni.  They state they have a product that works and still support it in case I have further problems.

--Harvey
Back to Top
harvey View Drop Down
Beginner
Beginner


Joined: 28 Oct 08
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote harvey Quote  Post ReplyReply Direct Link To This Post Posted: 30 Oct 08 at 2:33PM
Let me retract my prior statement - IT WORKS!!

So as I started to read how to install the Amuin product, I touched across a statement that never crossed my mind... the need to register the control into the Visual FoxPro application as an OLEControl.  I'm not sure if this is normally required for VFP or other platforms but after reading it I cane back to QuickPDF and under Tools > Options > Controls > ActiveX > Add and selecting the Ised.dll file and saving it back, your example worked.

However, and this is a bit strange... in the list of installed controls neither the QuickPDF nor the Ised control shows up in the list.  But I now have a control listed that has NO NAME - it is blank where all the other controls all show a name.

Sorry for ever doubting you or the tool...  Look forward to being able to contribute my results in the future.

Strange... Barcodes and text without having control worked before at all.... Just another programmers mastery.

Thanks again,
--Harvey
Back to Top
lcarrere View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 10 Jul 06
Location: France
Status: Offline
Points: 47
Post Options Post Options   Thanks (0) Thanks(0)   Quote lcarrere Quote  Post ReplyReply Direct Link To This Post Posted: 31 Oct 08 at 12:19PM
Harvey I suggest to do like that in vfp:


PRIVATE oIsed as Object


oIsed = CREATEOBJECT("Ised.QuickPDF")

WITH oIsed as Ised.QuickPDF
     && Here just type . to get intellisense working
ENDWITH


Best regards,

Loïc
Back to Top
harvey View Drop Down
Beginner
Beginner


Joined: 28 Oct 08
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote harvey Quote  Post ReplyReply Direct Link To This Post Posted: 31 Oct 08 at 9:39PM
Yea, thanks for your suggestion.  Actually before re-registering the control within VFP, making IntelliSense work had no effect.  After doing the CreateObject() in the command window, I was able to drill down into the methods, set properties and read back the revised values.  After registering it everything works perfectly.  Live and learn...Wink
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. About — Contact — Blog — Support — Online Store