Writing to PRN adding non existent spaces. #3063

Open
opened 2024-01-24 11:48:47 +00:00 by AA · 2 comments

29d46c07a8/bits/40_harb.js (L1099)

Due to this line of code, when a cell value is shorten than 10 characters, the original value is changed, I see no reasoning for this behaviour.

https://git.sheetjs.com/sheetjs/sheetjs/src/commit/29d46c07a895bdfd948d15b5115529ae697ccb48/bits/40_harb.js#L1099 Due to this line of code, when a cell value is shorten than 10 characters, the original value is changed, I see no reasoning for this behaviour.
Owner

That specifically applies to the Lotus Formatted Text (.PRN) format. For example, consider the following array of arrays:

[
  ["a", "b", "c"],
  [1, 2, 3]
]

The PRN version is

a         b         c
         1         2         3

The referenced code adds whitespace, but admittedly it should do something a little more intelligent than adding space characters in a loop (prepend when the value is numeric). There is no official spec, so the current strategies are based on observing how Lotus 1-2-3 and Excel generate PRN files.

That specifically applies to the Lotus Formatted Text (.PRN) format. For example, consider the following array of arrays: ```js [ ["a", "b", "c"], [1, 2, 3] ] ``` The PRN version is ``` a b c 1 2 3 ``` The referenced code adds whitespace, but admittedly it should do something a little more intelligent than adding space characters in a loop (prepend when the value is numeric). There is no official spec, so the current strategies are based on observing how Lotus 1-2-3 and Excel generate PRN files.
Author

I have observed that when used with excel the export to PRN created by it respects the column widths that are set. Anyhow, feel free to close the issue if you find it appropriate.

I have observed that when used with excel the export to PRN created by it respects the column widths that are set. Anyhow, feel free to close the issue if you find it appropriate.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#3063
No description provided.