EldoS | Feel safer!

Software components for data protection, secure storage and transfer

PDFBlackbox: Vowels/umlauts are not displayed in Widget

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#13874
Posted: 07/09/2010 04:28:38
by direct  (Standard support level)
Joined: 07/09/2010
Posts: 7

Hello,

I'm about to try signing a PDF document with PDFBlackbox VCL. I use Delphi 5.

There seems to be a problem when I use German vowels/umlauts in the WidgedProps. They aren't displayed in the PDF (see attached screenshot).

The code is...
sig.WidgetProps.ShowTimestamp := true;
sig.WidgetProps.SignerCaption := 'Jürgen Özil'; // <- vowels
sig.WidgetProps.Header := 'Header der Signatur';
sig.WidgetProps.AlgorithmCaption := 'Öffentlicher Schlüssel: '; // <-vowel
sig.WidgetProps.AutoFontSize := true;

I hope you could help me to solve this problem.

Regards,
dietmar


#13875
Posted: 07/09/2010 04:59:07
by Dmytro Bogatskyy (EldoS Corp.)

Please check samples (PDFBlackbox\TinySigner and/or SecurePDF). They contains three ways how to use non-ascii characters in the signature widget.
In the signature option window set "Widget font and encoding:" option to "Helvetica, Win-1252" to display vowels/umlauts correctly.
#13876
Posted: 07/09/2010 05:33:39
by direct  (Standard support level)
Joined: 07/09/2010
Posts: 7

Could you tell me where the TinySigner sample is located? I can't find any in the installation directory.

What do you mean with "signature option window"?
#13877
Posted: 07/09/2010 06:01:04
by Dmytro Bogatskyy (EldoS Corp.)

Quote

Could you tell me where the TinySigner sample is located? I can't find any in the installation directory.

The samples are installed to the All Users\Documents\EldoS directory.
Quote

What do you mean with "signature option window"?

It is a "Signature Options" form in SecurePDF sample or a main form in TinySigner sample.
#13884
Posted: 07/12/2010 06:28:33
by direct  (Standard support level)
Joined: 07/09/2010
Posts: 7

Many thanks for your help. Now I was able to have the vowels displayed, and the character spacing is ok.

But I want to use another font than "Helvetica" or "Times-Roman". When I, for exaple, use "Helvetica Compressed", the result isn't good. Let me describe it:

- When I set the SimpleFont.BaseFont to "Helvetica Compressed" (or an other font name except "Times-Roman" or "Helvetica", the PDF is signed, but when opened in Adobe Reader, an error message appears: "In der Schrift "Helvetica Comparessed" ist der Wert für /BBox fehlerhaft". In English: "In the font "Helvetica Compressed", the value of /BBox is erroneous." (as shown in attachment).
Also, the the widget font seems to remain Arial or standard Helvetica.
I already tried to use the name "Helvetica Condensed (TrueType)" as shown in the list of the windows fonts folder, and setting the SimpleFont.Subtype to "TrueType".

- When I instead use the first method with AddTrueTypeFont('ps_14526', Sig.WidgetProps) (here I have to know the exact filename of the font...), the wrong characters are displayed.
You can see this in the attachment.

I hope you can help me to solve this issue.


#13885
Posted: 07/12/2010 07:01:40
by Dmytro Bogatskyy (EldoS Corp.)

Quote
- When I set the SimpleFont.BaseFont to "Helvetica Compressed"

PDF supports 14 standard fonts, they are as follows: Times-Roman, Helvetica, Courier, Symbol, Times-Bold, Helvetica-Bold, Courier-Bold, ZapfDingbats, Times-Italic, Helvetica-Oblique, Courier-Oblique, Times-BoldItalic, Helvetica-BoldOblique, Courier-BoldOblique. These fonts, or their font metrics and suitable substitution fonts, shall be available to the PDF reader.
All other fonts and their font metrics should be embedded into pdf document.
There is a sample how to embed TrueType Font, see 'Free Serif, Unicode' option.
But you'll need to extract font metrics from ttf font file, along with a ttf file.
Quote
- When I instead use the first method with AddTrueTypeFont('ps_14526', Sig.WidgetProps) (here I have to know the exact filename of the font...), the wrong characters are displayed.

Did you extracted a font metrics?
#13892
Posted: 07/13/2010 02:57:36
by direct  (Standard support level)
Joined: 07/09/2010
Posts: 7

Ok, I just used the convert utility TTF2UFM.EXE to make a .UFM file from Helvetica Condensed. Now I can successfully use this font.

But, could you answer me the following questions:

1. Do you mean, that the only possibility to use a TrueType font for the widget is to use AddTrueTypeFont() with a corresponding .UFM file?

2. Why is this so complicated? Remember, this issue is "only" about displaying a simple text in a specific font! :|

Thanks for help!

Regards,
dietmar
#13895
Posted: 07/13/2010 05:34:00
by Dmytro Bogatskyy (EldoS Corp.)

Quote
1. Do you mean, that the only possibility to use a TrueType font for the widget is to use AddTrueTypeFont() with a corresponding .UFM file?
2. Why is this so complicated? Remember, this issue is "only" about displaying a simple text in a specific font! :|

1. No, you can replace AddTrueTypeFont() procedure with your code that'll do TrueType Font file parsing and extract font metrics. The AddTrueTypeFont() procedure just show the simplest way to do this at the moment.
Why? As far as I know PDF uses font metrics to speedup document rendering. So without them PDF wouldn't render text correctly. But TrueType Font file itself contains all necessary information.
And, SecureBlackbox is a security library in the first place, and not aimed at graphic library.
You are welcome to request and vote for this feature at http://eldos.com/sbb/wishlist.php
#13896
Posted: 07/13/2010 07:52:04
by direct  (Standard support level)
Joined: 07/09/2010
Posts: 7

Ok, I recognize...
But does this mean that the TrueType font will be converted to outlines to display the widget's text correctly even the font isn't installed on a system?

Quote
And, SecureBlackbox is a security library in the first place, and not aimed at graphic library.


Yes, I realize this. Although, it would be simplier to have, for example, a WidgetProps.HeaderFont property which is of standard Delphi type "TFont".

Thanks for the information about the wishlist.
#13911
Posted: 07/13/2010 13:45:27
by Dmytro Bogatskyy (EldoS Corp.)

Quote
But does this mean that the TrueType font will be converted to outlines to display the widget's text correctly even the font isn't installed on a system?

Yes, each Adobe PDF file encapsulates a complete description of a fixed-layout document that includes the text, fonts, images.
Quote
Although, it would be simplier to have, for example, a WidgetProps.HeaderFont property which is of standard Delphi type "TFont".

Sure, but it completely different things...
Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.

Reply

Statistics

Topic viewed 1685 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!