Print Page | Close Window

Help with Transparent DrawTextBox

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=865
Printed Date: 14 May 24 at 11:29AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Help with Transparent DrawTextBox
Posted By: jabaltie
Subject: Help with Transparent DrawTextBox
Date 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 ?



Replies:
Posted By: chicks
Date Posted: 13 Feb 08 at 11:14PM
I've done this in the past, don't remember exactly how, maybe SetTransparency() function?


Posted By: jabaltie
Date Posted: 14 Feb 08 at 5:18AM
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....




Posted By: chicks
Date Posted: 14 Feb 08 at 12:39PM
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.



Posted By: chicks
Date Posted: 14 Feb 08 at 12:55PM
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.


Posted By: jabaltie
Date Posted: 14 Feb 08 at 1:26PM
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 !


Posted By: chicks
Date Posted: 14 Feb 08 at 1:31PM
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.



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