*SOLVED* Pdf Editor Displaying Poor Number Formatting

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
sherron_docit
User
Posts: 12
Joined: Wed Apr 07, 2021 5:24 pm

*SOLVED* Pdf Editor Displaying Poor Number Formatting

Post by sherron_docit »

Hi there,

I have a custom calculator application that is embedded into the pdf editor.

The issue I am having is with copying the output into the pdf editor.

The output looks great in the app, and if you copy and paste the text into notepad it is formatted nicely like
so:
Image

But when I paste the same output into the pdf editor, the numbers are all out of place and the format looks bad:
Image

As you can see in the second image the numbers do not line up at all, the addition symbols are all over the place, etc.

Is there any way I could fix this somehow? It is important for the user to have these numbers formatted properly into their pdf documents.

Thanks,

Sam
Last edited by sherron_docit on Fri Dec 10, 2021 9:18 pm, edited 1 time in total.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8624
Joined: Wed Jan 03, 2018 6:52 pm

Re: Pdf Editor Displaying Poor Number Formatting

Post by TrackerSupp-Daniel »

Hello, sherron_docit

This is not a case of poor formatting, but a case of the default font you are using not having a unified size for every character. In your notepad application, it appears you are using "Consolas" but in the Editor, you are instead using what appears to be "Arial". You can change the default font for text content by following the steps here: https://www.pdf-xchange.com/knowle ... nge-Editor

Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Pdf Editor Displaying Poor Number Formatting

Post by Vasyl-Tracker Dev Team »

Hi Sam.

It depends what kind of data puts your embedded calculator to the clipboard. If just a plain text - the problem can be solved easily. But if it puts the rich-text with variable-width font specified(Arial, TimesNewRoman etc.) - there not be a good solution because our Paste obeys the rich-formatting from the clipboard.

So you may try to solve your problem using this:

pxvInst.Settings["Tools.TextBox.Style.TS.Font.Name"] = "CourierNewPSMT";
- it sets the 'Courier New' font postscript-name. This is typical monospaced font that will be user for new TextBox-comments creation. The Paste feature adds such type of comments when handles text from the clipboard..

HTH.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
sherron_docit
User
Posts: 12
Joined: Wed Apr 07, 2021 5:24 pm

Re: Pdf Editor Displaying Poor Number Formatting

Post by sherron_docit »

Hi Vasyl,

I have tried the following:
Vasyl-Tracker Dev Team wrote: Fri Dec 10, 2021 6:38 pm pxvInst.Settings["Tools.TextBox.Style.TS.Font.Name"] = "CourierNewPSMT";
It seems that .Settings is a readonly property.
Is there a way to set this? Possibly using pxvInst.LoadUserSettings() or pxvInst.Settings.Insert() ?

Sam
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Pdf Editor Displaying Poor Number Formatting

Post by Vasyl-Tracker Dev Team »

It seems that .Settings is a readonly property.
No, the Settings object is R/W definitely. What programming language do you use?

I added the:

pdfCtl.Inst.Settings["Tools.TextBox.Style.TS.Font.Name"].v = "CourierNewPSMT";

to our FullDemo C# example-project and it works as expected...
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
sherron_docit
User
Posts: 12
Joined: Wed Apr 07, 2021 5:24 pm

Re: Pdf Editor Displaying Poor Number Formatting

Post by sherron_docit »

We use Vb.net for this project.

I modified my syntax to match yours (I was missing the .v) and it compiled.

Unfortunately when I paste text into the document it still shows 'Arial' by default.

Any ideas?
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Pdf Editor Displaying Poor Number Formatting

Post by Vasyl-Tracker Dev Team »

Just for additional test - copy something from notepad and then paste to editor (be sure that Font.Name is changed before paste)..
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
sherron_docit
User
Posts: 12
Joined: Wed Apr 07, 2021 5:24 pm

Re: Pdf Editor Displaying Poor Number Formatting

Post by sherron_docit »

Vasyl-Tracker Dev Team wrote: Fri Dec 10, 2021 9:11 pm (be sure that Font.Name is changed before paste)
When I create a new textbox, the font showing by default is still 'Arial'.

Note: This was before I pasted anything.

Sam
sherron_docit
User
Posts: 12
Joined: Wed Apr 07, 2021 5:24 pm

Re: Pdf Editor Displaying Poor Number Formatting

Post by sherron_docit »

I got it Vasyl.

The issue was with the font name.

I changed this:

Code: Select all

pdfCtrl.Inst.Settings.Item("Tools.TextBox.Style.TS.Font.Name").v = "CourierNewPSM"
To this:

Code: Select all

pdfCtrl.Inst.Settings.Item("Tools.TextBox.Style.TS.Font.Name").v = "CourierNew"
It is now selecting Courier New by default. :D

I will mark this thread as solved.

Thank you so much for your help and have a fantastic weekend!

Sam
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8624
Joined: Wed Jan 03, 2018 6:52 pm

*SOLVED* Pdf Editor Displaying Poor Number Formatting

Post by TrackerSupp-Daniel »

:)
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: *SOLVED* Pdf Editor Displaying Poor Number Formatting

Post by Vasyl-Tracker Dev Team »

pdfCtrl.Inst.Settings.Item("Tools.TextBox.Style.TS.Font.Name").v = "CourierNewPSM"
Maybe "CourierNewPSMT" ?
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.