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!
SetTextSize() |
Post Reply |
Author | |
harvey
Beginner Joined: 28 Oct 08 Status: Offline Points: 5 |
Post Options
Thanks(0)
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 |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
harvey
Beginner Joined: 28 Oct 08 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
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 |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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; |
|
harvey
Beginner Joined: 28 Oct 08 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
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 |
|
harvey
Beginner Joined: 28 Oct 08 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
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 |
|
lcarrere
Debenu Quick PDF Library Expert Joined: 10 Jul 06 Location: France Status: Offline Points: 47 |
Post Options
Thanks(0)
|
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 |
|
harvey
Beginner Joined: 28 Oct 08 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
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...
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store