Print Page | Close Window

SetFormFieldAlignment for Button

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=3868
Printed Date: 06 May 24 at 12:10AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: SetFormFieldAlignment for Button
Posted By: PeterAnderko
Subject: SetFormFieldAlignment for Button
Date Posted: 09 Dec 20 at 7:59AM
Hi,

I tried to set the centered alignment for the new "formfield" that I created as a button for print.
here is a procedure: 

procedure CreatePrintButton(Menox:string);
var BTWidth,BTLocation:double;
    ix,strana:integer;
begin
strana:=1;
PDFDok.SetOrigin(1);
BTWidth:=45;
BTLocation:=91;
ix:=PDFDok.NewFormField(Menox,2);
if ix>0 then begin
   PDFDok.SetFormFieldCaption(ix,Menox);
   PDFDok.SetFormFieldAlignment(ix,1);
   PDFDok.SetFormFieldPrintable(ix,0);
   PDFDok.SetFormFieldBounds(ix,BTLocation,5,BTWidth,15);
   PDFDok.SetFormFieldFont(ix,PDFDok.GetFormFontCount);
   PDFDok.SetFormFieldTextSize(ix, 8);
   PDFDok.SetFormFieldBorderColor(ix, 0.9, 0, 0);
   PDFDok.SetFormFieldBorderStyle(ix, 0.2, 0, 0, 0);
   PDFDok.SetFormFieldColor(ix, 0, 0, 0);
   PDFDok.SetFormFieldBackgroundColor(ix,0.85,0.90,0.70);
   PDFDok.SetFormFieldValue(ix,'');
   PDFDok.SetFormFieldHighlightMode(ix,3);
   PDFDok.FormFieldJavaScriptAction(ix, 'U', 'this.print({' +
                                             'bUI: true,' +
                                             'bSilent: true,' +
                                             'bShrinkToFit: true,' +
                                             'nStart: ' + IntToStr(strana-1) + ',' +
                                             'nEnd: ' + IntToStr(strana-1) + '});');
   end;
end;

Despite setting up

   PDFDok.SetFormFieldAlignment(ix,1);

The alignment of the button caption (Menox) remains left-aligned. Confused
what I'm doing wrong?



Peter









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