Logo
My Account |  Site Map | Contact Us  
Welcome Guest Search | Active Topics | Sign In | Register

Filling in form field with a Swedish characters (or how to set encoding?) Options
Maxim
Posted: Tuesday, April 10, 2018 4:12:53 PM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
Hi,

Yeah, I saw that the font size is set to 10, that’s absolutely right that the library doesn’t change the font size.

I think the expected behavior will be to show what fits the text box, but not to show 2 lines of text (both cut) in a single line text box.

If you look how Adobe Acrobat reader or Google Chrome shows the value in these test boxes, you’ll see that the result EO.Pdf generates is quite uncommon.

I can set 0 font size to eliminate this “issue”, it’s not a problem for me. But I don’t think this behavior is the best. It’s impossible to read the text in the field. It’s more logical (for me) to do like other PDF tools do - show what fits in the textbox if the font is 10, but not show it in 2 lines.

Or is it something you’re not going to change?

Best regards,
Maxim
eo_support
Posted: Tuesday, April 10, 2018 4:38:28 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,466
We will look into this and see what we can do. But please don't jump on us on "is it possible to fix this issue for all files". It's quite obvious that this is a different issue than the one previously fixed. :)
Maxim
Posted: Friday, April 13, 2018 10:55:52 AM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
Hi!

I tested build *.41 I've got from you by email on the files which had issues. Passed all tests, thank you!

I'll run it again on all files we generate after adding it from the nuget, so I don't do the double work. When do you expect to release it there?

Best regards,
Maxim
eo_support
Posted: Friday, April 13, 2018 11:12:06 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,466
We just posted the new build to nuget. :)
Maxim
Posted: Tuesday, April 17, 2018 10:31:32 AM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
Hi guys,

This build is very good, thanks! I tested 80 from 200 files on it and found only 1 little issue.

When you fixed the lib not to write the text in 2 lines in a single line textbox I think you hide everything after and including the word which can't be fit. Maybe it's better to do so per character, not per word.

For example I enter 2 values "Stockholm, 2018-04-17" and "Gothenburg, 2018-05-17" and if only 1 or 2 numbers at the end can't fit, the whole date isn't visible.

I sent you the test files to support mail.

This is the issue at the printscreen: the link to the image

Please have a look. And please PLEASE do the change very carefully so nothing is changed in other cases we discussed here, our company simply can't afford another test on 80 files which I already tested. All previous issues are seemed to be fixed in this release.

Thanks,
Maxim
eo_support
Posted: Tuesday, April 17, 2018 10:46:21 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,466
Hi,

Glad to hear that this build works well for you. What you requested is not possible in the near future due to the way our layout engine works. Our layout engine always produces multiple lines output with word wrapping --- what the latest build did was to only retain the first line and discard additional lines. To retain partial words would require significant change of our layout engine and would risk introducing other problems. So the risk would out weight the benefit in this case. As such we do not believe it would be a good choice to pursue this feature at this time. Sorry about it!

Thanks!
Maxim
Posted: Tuesday, April 17, 2018 10:59:43 AM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
Hi,

I see, thanks for the explanation. Then I’ll have to set auto font size in the fields which get the value with a date at the end.

Best regards,
Maxim
Maxim
Posted: Friday, April 20, 2018 4:17:32 AM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
Hi again,

I noticed that when you set some value to the field, then set another font on the field and change its size to Auto and then save the file, the text which is shown in the field is autosized and has the right font, but if you click into the field you see that the font is changed to the one the file originally had. And if you view the properties of the field you see that the font name and the size wasn't changed on the field.

Looks like the text which is put in the field by the lib uses the values set by library, but the field doesn't get changed font name and size.

And I also see that the lib detects the wrong font on the field, the font is Times Roman and the lib shows Arial in field1.Font.Name.

See this image showing this: the link to the image

You can see it in action using the file 2.pdf from the ZIP file "TheIssue20180417-2.zip" I sent 17 April with this code:

Code: C#
var pdf2 = new EO.Pdf.PdfDocument(file);

var field1 = pdf2.Fields["Ort/datum sign 1"];
Display(field1.Font.Name); // shows Arial
Display(field1.Font.Size); // shows 12
field1.Font.Name = "Helvetica";
field1.Font.Size = 0;
field1.Value = "Valdemarsvik, 2018-04-20";

pdf2.Save(filledInFile);


I can't say it bothers me much right now, but it looks strange. Is it by design or is it a bug?

Best regards,
Maxim
Maxim
Posted: Friday, April 20, 2018 5:44:32 AM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
And another thing I'd like to ask you to add. It's something like MaxFontSize. Some PDF files we got from our customers have quite tall fields and this new version of library calculates very big font which looks silly, because the text above and below the fields is smaller several times.

I know it's a question to people to do such tall text box fields in PDF, but it is what we have. And it can be fixed very easily if we set MaxFontSize to 12 or 14 for example and then your function which calculates the font size for the fields with AUTO font size will compare at the every end the size you calculated with MaxFontSize and if it's bigger, then MaxFontSize will be used instead of calculated font size.

If I am right and it's that easy to add, could you please include it into the next build? It will be a HUGE help for us.
Maxim
Posted: Friday, April 20, 2018 5:50:27 AM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
This is the image which displays how silly it is in some files we generate: the link
Maxim
Posted: Friday, April 20, 2018 8:01:40 AM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
Hi again,

I tested on more than 200 files. All is fine, except the huge font sometimes. But again, it's not the issue of the library.

If you could add MaxFontSize property (with any name) working as I described above, it would be great. I even would like to get it without any other changes, i.e. without the fix for the possible issue I wrote about 3 posts above (I noticed that when you set some value to the field, then set anot...), so I don't have to test again.

Please let me know if it's possible to deliver this property/function to set max font size the library will use in Auto sized fields.

Best regards,
Maxim
eo_support
Posted: Friday, April 20, 2018 8:47:40 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,466
Hi,

This should be doable. We will look into it and get back to you as soon as possible.

Thanks!
eo_support
Posted: Friday, April 20, 2018 2:09:36 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,466
Hi,

We have looked into MaxFontSize issue. This will be added to our next build.

The other issue is by design (different font/size when user enters value). I remember that we explained to you earlier there are essentially two fonts involved with every field: one for programmatically filled value and one for interactively filled value. Replacing one with another will cause all kind of problems so we try to preserve both. As such changing programmatically filled font does not change the font used when enter value interactively. As such we will not make any change regarding this issue.

Thanks!
Maxim
Posted: Friday, April 20, 2018 3:10:22 PM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
Hi,

This sounds great, thank you! Have a good weekend!

Best regards,
Maxim
Maxim
Posted: Monday, April 23, 2018 2:37:56 AM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
Hello,

Could you please share when the next build is planned to be released?

Best regards,
Maxim
eo_support
Posted: Monday, April 23, 2018 8:57:24 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,466
It will be released this week.
eo_support
Posted: Thursday, April 26, 2018 4:33:13 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,466
Hi,

This is just to let you know that the new build has been posted. This is the new field added:

https://www.essentialobjects.com/doc/eo.pdf.pdffield.maxfontsize.aspx

Thanks
Maxim
Posted: Thursday, April 26, 2018 4:51:34 PM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
Hi,

Thank you very much!! I’ll try it tomorrow and will write here then!

Best regards,
Maxim
Maxim
Posted: Friday, April 27, 2018 3:47:39 AM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
Hi,

I tested on one file entering MaxFontSize = 12 or MaxFontSize = 14 and I see no expected result (the text is still huge). Then I tried to enter MaxFontSize = 2 (!) and the text isn't that big. But why 2? 2 font size will be tiny, not the one I see.

Code: C#
var filesPath = @"C:\Data\Dev\TheIssue20180427\";
var templateFileName = "Template";
var file = filesPath + templateFileName + ".pdf";
var filledInFile = filesPath + templateFileName + " (EO.Pdf version 2018.1.56).pdf";

var value = "Åsa Dägström some English text here Depå utanför";

// Fill the file in with EO.Pdf

var pdf = new EO.Pdf.PdfDocument(file);

pdf.Fields["Client name 1"].Value = value;
pdf.Fields["Client name 2"].Value = value;
pdf.Fields["Client name 3"].Value = value;

pdf.Fields["Client name 4"].MaxFontSize = 12;
pdf.Fields["Client name 4"].Value = value;

pdf.Fields["Client name 5"].Value = value;

pdf.Fields["Client name 6"].MaxFontSize = 10;
pdf.Fields["Client name 6"].Value = value;

pdf.Fields["Client name 7"].MaxFontSize = 2;
pdf.Fields["Client name 7"].Value = value;

pdf.Save(filledInFile);


Please see the image attached: the link to the image.

How is it supposed to work? Please tell me I somehow use it wrong and that you tested it before releasing. We already told our customers that it we would deploy it on Monday, because everything else was fixed and it was just a simple function (it seemed, I don't know how hard it is in PDF, maybe it is).

If I have a field with font 12 in PDF and then fill another field with AUTO font size and enter MaxFontSize = 12, shouldn't the font sizes be the same if auto calculated font size was much bigger than 12 ?

I'll email you the file I was testing on in 5 mins.

What's wrong in my code?

Best regards,
Maxim
Maxim
Posted: Friday, April 27, 2018 6:05:58 AM
Rank: Advanced Member
Groups: Member

Joined: 12/18/2013
Posts: 67
Hi again,

I tried to set MaxFontSize to 2 if the field has AUTO font size and tested on 70% of all files we generate (I'm still testing) and the result font size in AUTO fields looks very very good!

Code: C#
if (field.Font.Size == 0)
{
	field.MaxFontSize = 2;
}

But I still would like to get an explanation from you about this field. Is it supposed to be used with such little values like 1 or 2 and it means you will not touch it anymore and I can deploy with MaxFontSize = 2. Or should it look like font 12 from PDF template when MaxFontSize = 12 if the calculated font is much bigger (see the image from my previous post), meaning that the current implementation has a bug and you'll be changing how it works?

Thank you!

Best regards,
Maxim


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.