Re: GtkSource.PrintCompositor: How to possible printing plain text documents without lost blank lines and indentations?



On Sun, Oct 15, 2017 at 1:42 AM, Eric Cashon via gtk-app-devel-list
<gtk-app-devel-list gnome org> wrote:

The first thing that I would try out is to change the font that is being drawn to see if that works.

I am getting an impression that fonts are not going to make any
difference. The OP seems not interested in how the PDF *looks* at all;
rather, what it *means*.

Disclaimer: I am not an expert on the PDF format so the below may not
be completely accurate. Take it as a simplified description.

Disclaimer #2: I have not verified the original claim of what appears on output.


A PDF page is, essentially, a list of instructions of the form “at
position (X, Y), using the font F, render the string S”.

On input, the OP is feeding a text file with lots of blank lines and
spaces used for layout.

On output, the PDF seems to only contain instructions to render the
non-blank lines. pdftotext(1) without the -layout option simply
outputs the text from the instructions present in the PDF.

(pdftotext -layout interprets the instructions and attempts to
reconstruct page layout based on positions.)

For a sighted person, there is no difference in appearance between this PDF:

At 0 inches down, 0 inches across, render "alma"
At 4.667 inches down, 3.1 inches across, render "1"

and this PDF:

At 0 inches down, 0 inches across, render "alma"
At 0.167 inches down, 0 inches across, render ""
At 0.333 inches down, 0 inches across, render ""
…
At 4.5 inches down, 0 inches across render, ""
At 4.667 inches down, 0 inches across render "<31 spaces>1"

For a blind user and/or a third-party tool aimed at blind users, there
seems to be.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]