Print Page | Close Window

Multiline text form field

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


Topic: Multiline text form field
Posted By: skipper
Subject: Multiline text form field
Date Posted: 29 Jan 11 at 3:48AM
Hi all,
what is the right procedure to place a multiline text form field? I tried in different ways without success.

ix = pdflib.NewFormField(pFieldName, cText)   '--cText = 1
If ix <> 0 Then
 
pdflib.SetFormFieldTextFlags(ix,
1, 0, 0, 0, 0)
  pdflib.SetFormFieldBounds(ix, m_left, m_top, m_width, m_height)
  pdflib.SetFormFieldValue(ix, mVar)          '--mVar = string text variable

End If
 
This way does not work. The text is placed but then get cut at the end of bound. My intention is to autowrap the text content assigned to it, without inserting Chr(13) or Chr(13)+chr(10) . Calculating the right position of each single chr(13) would be a mess.
Is it possible? Could you please post few line of code?
 
many thanks
Mimmo



Replies:
Posted By: Ingo
Date Posted: 29 Jan 11 at 12:50PM
Hi Skipper!

Try a search here (knowledgebase of QuickPDF) for an answer:
http://help.quickpdflibrary.com/search?q=FormField
You can download a demo-app-maker from the official supportpages to test a little bit with the settings:
http://www.quickpdflibrary.com/blog/2009/10/a-customizable-demo-for-quick-pdf-library/

Cheers and welcome here,
Ingo



Posted By: skipper
Date Posted: 29 Jan 11 at 8:15PM
Hi Ingo,
 
many thanks for your reply and your welcome aboard. I agree with one of your customers that the suggested tools is a very valuable piece of software. It is the perfect complimentary tool for the help manual and for quick checking the still unknow functionalities of a such complex DLL.
 
I tested the sample code provided for the form fields and, with a quick modification, I got what I was asking for. I'll double check again my code because I don't see any difference between my code and the sample code. The only differences were the function call sequence and the text passed to the SetFormFieldValue() function. I'm using a variable, the sample use a constant text string. Changing both in the sample in order to replicate my code, I got the same expected result: the text wraps. Wink
 
I'll let you know if my code still does not work. Cry
 
Many thanks for now
Mimmo


Posted By: Dimitry
Date Posted: 30 Jan 11 at 12:09AM
Hi Mimmo,
 
Quick PDF Library contains essential functionality for form field text wrapping.
So if you need word wrapped or #13 wrapped form field text
please try this Delphi sample:
 
var
  f: Integer;

begin
  with QPL do
  begin
    // Create and unlock QPL here
    // . . .
    f := NewFormField('MultiText1', 1);
    SetOrigin(1);
    SetFormFieldBounds(f, 50, 50, 135, 80);
    SetFormFieldBackgroundColor(f, 0.8, 0.8, 1);
    SetFormFieldTextFlags(f, 1, 0, 0, 0, 0);
    SetFormFieldValue(1,
      'This text is wrapped using two basic types of wrapping: word wrap and #13 wrap' +
      #13 + 'Line 1...' + #13 + 'Line 2...' + #13 + 'Line 3...');   
    UpdateAppearanceStream(f);
    SaveToFile('output.pdf');
  end;
end;
 
If you still have some issues connected with form field text wrapping,
please link your problem PDF file and add detailed issue description.
 


-------------
Regards,
Dmitry


Posted By: Ingo
Date Posted: 30 Jan 11 at 12:52AM
Hi!

This is what Skipper has written:
"...
Calculating the right position of each single chr(13) would be a mess.
..."
He knows how to break lines. He thought that a multiline-field has an automatic word-wrapping included ;-)

Cheers, Ingo

@Skipper: I'm a user not the publisher ;-)
@Dmitry: Are you from Debenu?



Posted By: Dimitry
Date Posted: 30 Jan 11 at 12:57AM
Hi Ingo,
 
Well, multiline form field certainly has an automatic word-wrapping included :)
Just try attached code sample.
 


-------------
Regards,
Dmitry



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