Ask a Question related to Adobe Acrobat SDK, Design and Development.
-
GrexD@adobeforums.com #1
addWatermarkFromText- Text Alignment
I got the VB.Net sample code from the SDK zip and I'm programming against Acrobat 8. I had no problems modifying the code for my own use except for the 4 parameters that position the text: nHorizAlign, nVertAlign, nHorizValue, nVertValue
The code does not have any named constants for the parameters (I didn't see anything in lac.vb). I've sort of got it working, but in order to get the text to appear higher on the page I increase the value of nVertValue. This seems counter-intuitive.
nVertValue = 200 puts the text higher than nVertValue = 20. What is the correlation and are the constants for nHorizAlign and nVertAlign listed anywhere?
Thank you,
Greg
GrexD@adobeforums.com Guest
-
Dynamic Text Box Text alignment
hi, I want to align text of the dynamic textbox to justify. How to do this ...? Is it possible to do using html tags...? pl post a response it is... -
SVG Export, text alignment problem
We use Illustrator 10 to edit the graphical part of our dynamic SVG. These graphics are then animated using javascript within the Adobe SVG viewer.... -
Text box vertical alignment... is it possible?
Well the title said it all... except this: if it is, how?!? -
Flash & Text alignment
I'd like to have a webpage with a Flash movie at the top and plain text (not part of the flash movie) just to the right of it. I can NOT use any... -
alignment of text through code
Hi all, What is the easiest way of changing the alignment of one line of a multi lined text box through code. I tried many variations of... -
Joel_Swota@adobeforums.com #2
Re: addWatermarkFromText- Text Alignment
Hi Greg,
I am currently battling the same issue. It seems like you are a month ahead of me so you probably know more that i do at this point.
What i have found is that there a constants for nHorizAlign and nVertAlign but the jso.addwatermarkfromtext method is looking for and integer value. The Adobe SDK shows:
app.constants.align is an object that has the possible properties left, center, right, top, and bottom, indicating the type of alignment. These values can be used to specify alignment, such as when adding a watermark.
I guess the values for left, center, right, top, and bottom are 1, 2, 3, 4 and 5 respectively. I have tinkered with the numbers alot and have not seen the results i would expect. I can change the location in the horiz direction with nHorizAlign but the nVertAlign doesn't seem to do anything.
Let's start with 0. If everything is 0 (nHorizAlign, nVertAlign, nHorizValue and nVertValue) then the stamp ends up in the middle of the page. What i am doing is using the page size to determine the location of the stamp.
'Get page size for stamp placement
Dim pdf_Page As Acrobat.CAcroPDPage
Dim pg_Size As Object
Dim pg_Rotation As Object
pdf_Page = pdDoc.AcquirePage(0)
pg_Size = pdf_Page.GetSize
pg_Rotation = pdf_Page.GetRotate
Dim s_X As Double
Dim s_Y As Double
s_X = (pdf_Page.x / -2) 'Dividing -2 moves to left edge
s_Y = (pdf_Page.y / -2)
You can play with the numbers. You need to add a little here and there to get the stamp exactly where you want it but it works ok.
Also, if the bPercentage is set to True then the nHorizValue and nVertValue represent the percentage of the page to offset. This is ok but doesn't give consistant results if the pages are different sizes.
The only thing left that i need to figure out is how to justify text. If i try to put text in a corner it still runs off the edge sometimes as the text length changes for different stamp text.
I hope this helped you more than confused you. Please, let me know if you have had any Eureka! moments in the past month that you would like to share.
Joel
Joel_Swota@adobeforums.com Guest



Reply With Quote

