EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Custom PDF Signature Appearance

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#24070
Posted: 03/13/2013 13:34:32
by Kristof Dely (Standard support level)
Joined: 07/08/2011
Posts: 4

Dear Support!

I'm playing with custom PDF signature appearances.
I need a specific background image and custom text displayed in the widget.
It's seems that the background image is displayed incorrectly. Custom text looks good.
I have attached the screenshot of the rendered PDF. The reference signature image is above the real signature widget.

Here is my Delphi code (added to TinySigner's sample code):
Code
var
  ImageF : File;
  Buf : ByteArray;

...

        Sig.WidgetProps.AutoPos:= false;
        Sig.WidgetProps.AutoSize:= false;
        Sig.WidgetProps.OffsetX:= 63;
        Sig.WidgetProps.OffsetY:= 550;
        Sig.WidgetProps.Width:= 180;
        Sig.WidgetProps.Height:= 70;
        Sig.WidgetProps.BackgroundStyle   := pbsCustom;
        Sig.WidgetProps.Background.ImageType:= pitJPEG;
        Sig.WidgetProps.Background.Height:= 480;
        Sig.WidgetProps.Background.Width:= 180;
        AssignFile(ImageF, 'c:\dev\PDF\background_256.jpg');
        Try
          system.Reset(ImageF, 1);
          SetLength(Buf, FileSize(ImageF));
          system.BlockRead(ImageF, Buf[0], Length(Buf));
        Finally
          CloseFile(ImageF);
        End;
        Sig.WidgetProps.Background.Data := Buf;
        Sig.WidgetProps.AutoStretchBackground:= true;
        Sig.WidgetProps.AutoFontSize:= false;
        Sig.WidgetProps.HideDefaultText := true;
        Sig.WidgetProps.CustomText.Add('KIADMÁNYOZVA                                       2012.11.20.', 5, 31, 7); //line 1
        Sig.WidgetProps.CustomText.Add('Zala Megyei Kormányhivatal', 5, 23, 5.7); //line 2
        Sig.WidgetProps.CustomText.Add('#I9# kerületi Állategészségügyi és Élelmiszerellenőrző hivatala', 5, 17, 6.2); //line 3
        Sig.WidgetProps.CustomText.Add('hatóság elnevezése 3. sor', 5, 12, 5.7); //line 4
        Sig.WidgetProps.CustomText.Add('Nagymihályi Eszter, főosztályvezető', 5, 6, 5.7); //line 5


#24071
Posted: 03/13/2013 13:36:10
by Kristof Dely (Standard support level)
Joined: 07/08/2011
Posts: 4

I also attached the source background image.


#24074
Posted: 03/13/2013 14:10:43
by Dmytro Bogatskyy (EldoS Corp.)

Thank you for contacting us.

Code
Sig.WidgetProps.Background.Height:= 480;
Sig.WidgetProps.Background.Width:= 180;


Background image size is X: 480, Y: 180
You are set a wrong values for Height and Width properties.
#24104
Posted: 03/14/2013 11:15:46
by Kristof Dely (Standard support level)
Joined: 07/08/2011
Posts: 4

Thanks, I switched Height with Width value.
Now, working great.

Is this possible to format the first custom line with bold font?
As I seen I couldn't add formatting options to CustomText lines.
#24109
Posted: 03/14/2013 17:02:10
by Dmytro Bogatskyy (EldoS Corp.)

Quote
Is this possible to format the first custom line with bold font?
As I seen I couldn't add formatting options to CustomText lines.

There is no option for this at the moment.
A possible solution for this would be to add additional font (for example 'Helvetica-Bold') and then reference it.
See a following message for details how a custom text is formatted:
https://www.eldos.com/forum/read.php?F...ssage23199
To specify additional text font for a text, you would need to use CustomData property like in the message above: but to change 'T1_0' with your font resource name on the line '/T1_0 1 Tf'.
Another solution is to change graphic operators from the message above. For example, to change text rendering mode (to '1 Tr'), but it is a font specific mode.
Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.

Reply

Statistics

Topic viewed 1901 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!