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!
Help with Transparent DrawTextBox |
Post Reply |
Author | |
jabaltie
Senior Member Joined: 08 Nov 05 Location: Brazil Status: Offline Points: 138 |
Post Options
Thanks(0)
Posted: 12 Feb 08 at 11:23AM |
Hello !
I need to DrawTextBox on top of a background image. So, I needed the box to be transparent. How can I do that ? Here's a test script : OPTION EXPLICIT DIM objQPDF,lni,lnt DIM X1,Y1,W1,H1,A1,S1,TW Set objQPDF = WScript.CreateObject("ISED.QUICKPDF") objQPDF.unlockkey("yourkey") objQPDF.NewDocument() objQPDF.DocumentCount() objQPDF.LoadFromFile("TEST037.PDF") ' YOU MAY GET TEST037.PDF from http://www.DES.online.unimep.br/au/pub/TEST037.pdf lni=1 X1=objQPDF.GetFormFieldBound(lni,0) Y1=objQPDF.GetFormFieldBound(lni,1) W1=objQPDF.GetFormFieldBound(lni,2) H1=objQPDF.GetFormFieldBound(lni,3) A1=objQPDF.GetFormFieldAlignment(lni) S1=objQPDF.GetFormFieldTextSize(lni) lnt=objQPDF.FORMFIELDCOUNT() for lni=lnt to 1 step -1 wscript.Echo objQPDF.GetFormFieldTitle(lni) objQPDF.DeleteFormField(lni) next objQPDF.SetTextAlign(0) objQPDF.SetTextSize(S1) TW=objQPDF.GetTextWidth("JOSE ADRIANO BALTIERI") CALL objQPDF.DRAWTEXTBOX(X1,Y1,W1,H1,"JOSE ADRIANO BALTIERI",0) WScript.Echo objQPDF.SaveToFile("TEST037OUT.PDF") WScript.Echo "OK !" When I draw "JOSE ADRIANO BALTIERI", I needed it to be in transparent mode. Any help ? |
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
I've done this in the past, don't remember exactly how, maybe SetTransparency() function?
|
|
jabaltie
Senior Member Joined: 08 Nov 05 Location: Brazil Status: Offline Points: 138 |
Post Options
Thanks(0)
|
Yeah, I had seen that before but it doesnt work.
It sets the transparency of the TEXT itself but I need something to set the transparency of the BOX underneath.... |
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
I think your problem is with the form fields themselves. They aren't transparent, and are overwriting the image underneath. QuickPDF deletes them, but not the white background.
What you can do is use the PDF with the form fields to get your locations, but use the original PDF without the form fields to write your text on. |
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
Yep, just validated this. Loaded the PDF in NitroPDF, removed the form fields, and saved. The white blocks are still there.
Whatever you're using to add the form fields is the actual problem. |
|
jabaltie
Senior Member Joined: 08 Nov 05 Location: Brazil Status: Offline Points: 138 |
Post Options
Thanks(0)
|
Sorry, I dont get it.
You mean that the problem is on the PDF template itself or on my script ? Should I use something else to draw my template then I'd be ok, is it ? Thanks ! |
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
The problem is with the PDF template. The form fields are wiping out the image underneath. Deleting the form fields leaves the white blocks.
If you use the original PDF before you added the form fields, the problem will go away. Just get your field locations from the one with the form fields. |
|
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