Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential carriage return displaying in assembled document #125

Open
JessicaFrank opened this issue Sep 30, 2022 · 14 comments
Open

Potential carriage return displaying in assembled document #125

JessicaFrank opened this issue Sep 30, 2022 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@JessicaFrank
Copy link
Contributor

Template with an address field on one line. User enters address in GI in field type, text long, and adds returns after each line like:
1 Main Street
Lexington, KY 12345
Address line 3 test

In assembled doc, it looks like a carriage return is printing over the "L" in Lexington and "A" in Address. Also looks like a question mark potentially. It's not clear because it overlays the other letters.

image

Interview at question -
Petition for Domestic Violence Protection 9-1-2022 (3).zip

Issue seen in the 1st template with variable [Location for Coming Near 1 TE]

Answer file with that variable holding a value. (zipped b/c Github doesn't allow .anx uploads)
answer - 2022-09-30T121949.410.zip

Possible solution is to warn user to not enter the address with hard returns, but that won't guarantee no errors like this on assembled document. Ideally A2J Author would not display those hard returns and would instead return them as spaces?

@JessicaFrank JessicaFrank added the bug Something isn't working label Sep 30, 2022
@tobiasnteireho
Copy link
Collaborator

tobiasnteireho commented Sep 30, 2022

not seeing this when assembling with above anx on a2jauthor.org with MacOS Monterey on Firefox 104.0.2. Font issue?

Screen Shot 2022-09-30 at 1 53 47 PM
petition-for-domestic-violence-protection-9-1-2022-test-assemble.pdf

@tobiasnteireho tobiasnteireho self-assigned this Sep 30, 2022
@tobiasnteireho
Copy link
Collaborator

@JessicaFrank where are you observing this and on what kind of setup (OS, browser, etc)

@JessicaFrank
Copy link
Contributor Author

Unsure of original report set up, but I observed it on production a2jauthor.org - Windows 10 Pro, Chrome Version 105.0.5195.127

@tobiasnteireho
Copy link
Collaborator

@JessicaFrank can you please post the pdf generated?

@JessicaFrank
Copy link
Contributor Author

@tobiasnteireho
Copy link
Collaborator

looks like an os font issue as it is fine on my Mac. Do the question mark boxes render for you in the pdf I attached in the comment above?

Screen Shot 2022-09-30 at 3 15 56 PM

@tobiasnteireho
Copy link
Collaborator

@JessicaFrank do you see the issue in the attached pdf and does the attached answer file generate no boxes?
[petition-for-domestic-violence-protection-9-1-2022-test-assemble-crlf.pdf](https://github.com/CCALI/a2jdat/files/9687796/petition-for-domestic-violence-prot
answer - 2022-09-30T121949.410-crlf.anx.zip
ection-9-1-2022-test-assemble-crlf.pdf)

@tobiasnteireho
Copy link
Collaborator

tobiasnteireho commented Sep 30, 2022

replaced \n with \r\n if works may need to add a filter before rendering pdf

@JessicaFrank
Copy link
Contributor Author

@tobiasnteireho still see the issue using the answer file you shared above.
image

and in the PDF

@tobiasnteireho
Copy link
Collaborator

tobiasnteireho commented Sep 30, 2022

Well that's odd. Not appearing in Windows Server 2016 and looks fine.

@tobiasnteireho
Copy link
Collaborator

actually the pdf linked here (#125 (comment)) looks fine in Server 2016 also so this might be limited to non server windows

@tobiasnteireho
Copy link
Collaborator

tobiasnteireho commented Oct 3, 2022

reproduced in preview, chrome, and foxit reader on mac and windows. PDF spec does not support printing newlines these need to be stripped or converted to breaks https://stackoverflow.com/questions/51090307/pdf-showing-wrong-character-instead-of-line-feed . In spec is treated as EOL https://ghostscript.com/~robin/pdf_reference17.pdf. Firefox is apparrent outlier that may not quite follow spec.

@tobiasnteireho
Copy link
Collaborator

I think the best solution in the meantime is for the address to not be collected in one field and to use multiple single line fileds. This will prevent newlines from being able to be entered at all. The multiple fields can then be concatenated to be displayed on one line.

@JessicaFrank
Copy link
Contributor Author

The issue for this particular template is that if the author collects in multiple fields and concatenates them on the single line, there's the potential for part of the address to be cut off (ex. If street name runs longer than the allotted space on the line for that field, it'll be cut off.) They could put a character count on a single field for the entire line. They could also leave as is and ask their users not to put line breaks in. I'll talk to the author and give them all the suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants