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!
Problem with setting formfieldfont |
Post Reply |
Author | |
Josef Gschwendtner
Beginner Joined: 23 Mar 16 Location: Germany Status: Offline Points: 14 |
Post Options
Thanks(0)
Posted: 23 Mar 16 at 10:15AM |
Hi,
we have a problem find the right way to set the font of a formfield. Below the code we did try: PDF := TDebenuPDFLibrary.Create; UnlockResult := PDF.UnlockKey(cDebenuLicenseKey); try if (UnlockResult = 1) then begin // Load Template PDF.LoadFromFile(ATemplate, ''); // Set the paper size PDF.SetPageSize('A4'); // Set the origin to the top-left corner PDF.SetOrigin(1); // Set the measurement units to millimetres PDF.SetMeasurementUnits(1); FontID := PDF.AddTrueTypeFont('Arial', 0); FieldIndex := APDF.NewFormField('LvBez', 1); PDF.SetFormFieldBounds(FieldIndex, ALeft, ATop, AWidth, AHeight); PDF.SetFormFieldPage(FieldIndex, APageNumber); PDF.SetFormFieldFont(FieldIndex, FontID); FontID := PDF.AddTrueTypeFont('Courier New', 0); FieldIndex := APDF.NewFormField('LvNr', 1); PDF.SetFormFieldBounds(FieldIndex, ALeft, ATop, AWidth, AHeight); PDF.SetFormFieldPage(FieldIndex, APageNumber); PDF.SetFormFieldFont(FieldIndex, FontID); // Compress the contents of the file PDF.CompressContent; // Save File PDF.SaveToFile(AFileName); end; finally PDF.Free; end; The second field should have font "Courier New" but it doesn't. Could anybody help us to understand better how to do this. Regards, Josef |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Josef,
i've read inside the online reference and there i've found this: http://www.debenu.com/docs/pdf_library_reference/AddFormFont.php This should mean that first there's your AddTrueTypeFont... at last there's your SetFormFieldFont ... but in the middle there should be the still missing AddFormFont ;-) Try it ... hope it helps. Cheers and welcome here, Ingo |
|
Cheers,
Ingo |
|
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