MAC OSX Printer Dialogue Box and ASCII 12

Talk about anything at all....
Post Reply
cathywelsh
Posts: 10
Joined: Fri Jul 16, 2021 10:47 pm

MAC OSX Printer Dialogue Box and ASCII 12

Post by cathywelsh »

I am working with Open Office and I have simple TEXT files that have embedded ASCII 12 (HEX 0C) aka FF (form feed) characters to control the page advancing. Writer sees the ASCII 12 characters just fine, and when I tell it to Print, it interprets it correctly, even if I tell it to Open in Preview if I chose the PDF option from the Dialogue Box. My question, is I am working with one of the MAC specific Terminal Emulation companies (don't want to use their name but they have been around for over 30 years), and they are telling me that they have to strip the ASCII 12 out of the feed before it gets to the Print Dialogue box or else it causes a problem. He is telling me that Open Office, MS Word, Apple PAGES, are sending specific set of instructions to the MAC Printer Dialogue box and telling it that if it sees an ASCII 12 to do some action.

Does anyone know what it is doing, or substituting for the ASCIi 12?????? I am working with Apple support and have development involved and a 2nd call next week, but this has been an ongoing problem now for months, and am stuck. I have more and more clients that want to use MACS, and this particular terminal emulation worked beautifully in the 32-bit version, but when they had to migrate to 64-bit, lots of issues popped up.
Apple TEXTEDIT does not even acknowledge the ASCII 12 at all, but Apple PAGES sees them and deals with them correctly.

Any suggestions other than move to another Terminal emulation package?
Last edited by MrProgrammer on Wed Jul 21, 2021 2:43 am, edited 1 time in total.
Reason: Moved to to General Discussion forum since OP says: There is NOT a problem with opening this document in Open Office
MAC 10.15.7
Open office 4.1.7
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: MAC OSX Printer Dialogue Box and ASCII 12

Post by RusselB »

Welcome to the Forums.
Without knowing what the employee(s) at the specific company that is encountering problems are seeing, it is impossible to diagnose what might be the actual cause and/or come up with a solution.
Technically when the printer system sees the ASCII 12, it should do an action, namely a form feed.
This is the same with Windows computers, so the fact that this is showing up on Macs is of little or no relevance.
I suggest you contact the company that is reporting a problem and have them tell you, very specifically, just what is happening.
Better yet, if you can arrange it, go to the company yourself and see the problem in action., that way you get a first hand view of what is happening.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
cathywelsh
Posts: 10
Joined: Fri Jul 16, 2021 10:47 pm

Re: MAC OSX Printer Dialogue Box and ASCII 12

Post by cathywelsh »

The developer of the terminal emulation software stated that the ASCII 12 was causing issues with the Print Dialogue box itself. He told me that sending an ASCII 12 to the Print Dialogue box causes it to do a Carriage Return/Line Feed instead of a Form Feed.
He kept referring me to https://stackoverflow.com/questions/584 ... -printable
He is telling me that on MAC the terminal command lp or lpr does process ascii 12 as a form feed But the OSX print dialog box does not.

I honestly believe he is confusing ASCII 13 and ASCII 12, but he tells me he is not. I know there is a difference between how Windows handles CR/LF and how UNIX based systems do, but he is stating this is NOT the problem. This software developer has been in business for over 30 years developing applications for MAC.

I have taken a plain TEXT file with imbedded ASCII 12 characters and from inside Open Office, the print Dialogue box handles them fine, and prints out the page breaks correctly, but he is telling me because these word processing programs are filtering the data while sending to the Print Dialogue box and when they see the ASCII 12, they are stripping it and sending something else in it's place.

I know this sounds crazy, but this is what I am dealing with. I am also working with Apple Development Support, as their TEXTEDIT app completely ignores the ASCII 12, which kind of gives credence to what this developer is stating, even though Apple's PAGES app handles the Form Feeds correctly.
MAC 10.15.7
Open office 4.1.7
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: MAC OSX Printer Dialogue Box and ASCII 12

Post by John_Ha »

Please upload a small example file showing the problem so that it can be tested. I want to be certain I have the exact character you are using.

Press POSTREPLY and click the Upload attachment tab below where you type (128 kB max); or use a file share site, Dropbox or Google Drive for a larger file.

That being said, I don't think AOO is the correct program to edit files with control characters and I sympathise with his view that AOO may be stripping control characters during the print process. AOO is a word processor designed for editing text documents which are stored as properly formatted XML files without control characters. It sounds like you need a generic file editor for editing ASCII files.

This is how AOO/LO saves the two page document test.odt where I inserted a page break. Note the page break is coded in the P4 style applied to the first paragraph on the new page "This appears after an inserted page break." as

Code: Select all

<style:style style:name="P4" style:family="paragraph" style:parent-style-name="Standard">
         <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.0783in" style:contextual-spacing="false" fo:break-before="page"/>.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<office:document-content xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:officeooo="http://openoffice.org/2009/office" office:version="1.3">
	<office:scripts/>
	<office:font-face-decls>
		<style:font-face style:name="Lohit Devanagari1" svg:font-family="&apos;Lohit Devanagari&apos;"/>
		<style:font-face style:name="Liberation Serif" svg:font-family="&apos;Liberation Serif&apos;" style:font-family-generic="roman" style:font-pitch="variable"/>
		<style:font-face style:name="Times New Roman" svg:font-family="&apos;Times New Roman&apos;" style:font-family-generic="roman" style:font-pitch="variable"/>
		<style:font-face style:name="Liberation Sans" svg:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/>
		<style:font-face style:name="Lohit Devanagari" svg:font-family="&apos;Lohit Devanagari&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
		<style:font-face style:name="Source Han Sans CN Regular" svg:font-family="&apos;Source Han Sans CN Regular&apos;" style:font-family-generic="system" style:font-pitch="variable"/>
	</office:font-face-decls>
	<office:automatic-styles>
		<style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard" style:master-page-name="">
			<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.0783in" style:contextual-spacing="false" style:page-number="auto"/>
			<style:text-properties style:font-name="Times New Roman" officeooo:rsid="0016d2b2" officeooo:paragraph-rsid="0016d2b2"/>
		</style:style>
		<style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard">
			<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.0783in" style:contextual-spacing="false"/>
			<style:text-properties style:font-name="Times New Roman" officeooo:rsid="0016d2b2" officeooo:paragraph-rsid="0016d2b2"/>
		</style:style>
		<style:style style:name="P3" style:family="paragraph" style:parent-style-name="Standard">
			<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.0783in" style:contextual-spacing="false"/>
			<style:text-properties style:font-name="Times New Roman" officeooo:rsid="0016d2b2" officeooo:paragraph-rsid="0016d2b2"/>
		</style:style>
		<style:style style:name="P4" style:family="paragraph" style:parent-style-name="Standard">
			<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.0783in" style:contextual-spacing="false" fo:break-before="page"/>
			<style:text-properties style:font-name="Times New Roman" officeooo:rsid="00185d8c" officeooo:paragraph-rsid="00185d8c"/>
		</style:style>
	</office:automatic-styles>
	<office:body>
		<office:text text:use-soft-page-breaks="true">
			<text:sequence-decls>
				<text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
				<text:sequence-decl text:display-outline-level="0" text:name="Table"/>
				<text:sequence-decl text:display-outline-level="0" text:name="Text"/>
				<text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
				<text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
			</text:sequence-decls>
			<text:p text:style-name="P1">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </text:p>
			<text:p text:style-name="P2">Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </text:p>
			<text:p text:style-name="P2">Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</text:p>
			<text:p text:style-name="P2"/>
			<text:p text:style-name="P4">This appears after an inserted page break.</text:p>
		</office:text>
	</office:body>
</office:document-content>
Attachments
test.odt
(11.7 KiB) Downloaded 264 times
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
cathywelsh
Posts: 10
Joined: Fri Jul 16, 2021 10:47 pm

Re: MAC OSX Printer Dialogue Box and ASCII 12

Post by cathywelsh »

I am unsure what AOO is, I am assuming it is the name of the MAC Print dialogue BOX routine, but am not sure. I know it is Definitely not the name of the Terminal Emulator App that that I am using.


The developer of the terminal emulation software is STRIPPING the ASCII 12 characters, not the MAC Print Dialogue Box.
He said if he does not strip the ASCII 12 characters, then the Print Dialogue box interprets them as a CR/LF.

I have attached the Category Listing.txt. This is just a plain text document, that has embedded ASCII 12 in it. This is generated and passed to the Terminal Emulation software from a UNIX SERVER.
I believe there are at least 8, possibly 9 FF contained within it.
We send this transparently from the terminal emulation software, and this is when the MAC OSX Printer Dialogue box appears. But behind the scenes, the terminal
emulation software strips the ASCII 12 characters before it gets to the MAC processing in the Printer DIalogue Box, causing there to be no Proper Page Breaks at all.

You can see from the TEXT that it should be page breaking so that the 1st line on each page has information that contains "RUN DATE and on the far right PAGE 000?".

Any help is greatly appreciated. This terminal emulation software is for vt220 emulation, and he has been developing this software for 32 years.
Attachments
category Listing.txt
(44.73 KiB) Downloaded 262 times
MAC 10.15.7
Open office 4.1.7
cathywelsh
Posts: 10
Joined: Fri Jul 16, 2021 10:47 pm

Re: MAC OSX Printer Dialogue Box and ASCII 12

Post by cathywelsh »

Ok, now I just googled AOO is Apache Open Office. It works correctly in Open Office. There is NOT a problem with opening this document in Open Office, just trying to figure out why it works in Open Office and why Apple TEXTEDIT it is broken.
'Trying to find a developer on this community forum that may know more about the inner workings of the MAC printer Dialogue box.
MAC 10.15.7
Open office 4.1.7
User avatar
RoryOF
Moderator
Posts: 34570
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: MAC OSX Printer Dialogue Box and ASCII 12

Post by RoryOF »

I doubt you will find any developers on the Forum. If you are capable of examining it and changing it, the source code is freely available to download at
git clone https://gitbox.apache.org/repos/asf/openoffice.git

Building guides for MacOS are at
1: https://wiki.openoffice.org/wiki/Docume ... _Guide_AOO

2: https://wiki.openoffice.org/wiki/Docume ... _on_MacOsX

3: https://svn.apache.org/viewvc/openoffic ... iew=markup
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
cathywelsh
Posts: 10
Joined: Fri Jul 16, 2021 10:47 pm

Re: MAC OSX Printer Dialogue Box and ASCII 12

Post by cathywelsh »

This is extremely helpful. Thank you.
MAC 10.15.7
Open office 4.1.7
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: MAC OSX Printer Dialogue Box and ASCII 12

Post by John_Ha »

cathywelsh wrote: I believe there are at least 8, possibly 9 FF contained within it.
They are not displayed in AOO (sorry about the acronym :oops: ).

Open it with Notepad++ where they are displayed on lines 62, 123, 184, 245, 306, 367, 428 and 453.

When I open the file with AOO and save it as a .txt file they are stripped out.

As you say, this is not an AOO problem - it is a problem with the other software handling. I would not be at all surprised that the software strips the FF.

As workaround would be to know how many lines there are on each page and print it as a single stream which will/should break appropriately.
Attachments
Clipboard01.png
Clipboard01.png (13.13 KiB) Viewed 8632 times
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
cathywelsh
Posts: 10
Joined: Fri Jul 16, 2021 10:47 pm

Re: MAC OSX Printer Dialogue Box and ASCII 12

Post by cathywelsh »

When I open this file in AOO, the FF are still in tact and when you go to print the file, the formfeeds are present, and page break correctly even if you tell it to open in preview.

The file that I sent to you was not from the terminal emulator, but the actual report spooled to the disk drive on the UNIX Server that created it. I can send you the Hexdump on it as well.

But if you open this file with Apple TEXTEDIT, the FORMFEEDS are completely stripped out, even if you don't save it. It is like TEXTEDIT does not know how to handle them, regardless of the encoding, which I tried Western and both of the Unicodes 8 and 16. No difference.


Also, NEVER stated this was an AOO problem. I have stated through this entire thread, that AOO is handling it correctly!

I was trying to get assistance by a developer that may lead me to where to look, and the former reply supplied me with the link to the SOURCE code which will more than likely help us with the problem the Terminal Emulation software company is having.
MAC 10.15.7
Open office 4.1.7
cathywelsh
Posts: 10
Joined: Fri Jul 16, 2021 10:47 pm

Re: MAC OSX Printer Dialogue Box and ASCII 12

Post by cathywelsh »

Also, I did not state the Form Feeds were Visible in AOO, I stated they were handled properly, meaning when you view the file it is page breaking properly on the screen and on printing.
MAC 10.15.7
Open office 4.1.7
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: MAC OSX Printer Dialogue Box and ASCII 12

Post by John_Ha »

cathywelsh wrote:Also, NEVER stated this was an AOO problem. I have stated through this entire thread, that AOO is handling it correctly!
...
Also, I did not state the Form Feeds were Visible in AOO, I stated they were handled properly, meaning when you view the file it is page breaking properly on the screen and on printing.
Sorry - my bad as I misread your post. :knock:

That being said I came to it with the expectation it would be an AOO problem as it was posted on the AOO forum! :super:

You need a programmers forum - see 10 Best Active Forums for Programmers or, better, one dealing with MacOS topics.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
cathywelsh
Posts: 10
Joined: Fri Jul 16, 2021 10:47 pm

Re: MAC OSX Printer Dialogue Box and ASCII 12

Post by cathywelsh »

Thank you much for the reply and the information. Greatly appreciated.
MAC 10.15.7
Open office 4.1.7
Post Reply