[scribus] No spaces (code 32) in PDF files produced by Scribus

William Bader williambader at hotmail.com
Sun Dec 14 02:56:45 UTC 2014



> Date: Sat, 13 Dec 2014 09:36:38 -0500
> From: gpittman at iglou.com
> To: scribus at lists.scribus.net
> Subject: Re: [scribus] No spaces (code 32) in PDF files produced by Scribus
> 
> On 12/13/2014 08:47 AM, Eric Dodémont wrote:
>> I am converting PDF files to fixed layout ePub files, which mean mainly
>> converting PDF to HTML.
>> 
>> I noticed something strange.
>> 
>> 
>> When converting PDF files produced by Scribus, the HTML displays very well,
>> but when I copy/paste a selected text, there is no “spaces” in the text!
>> 
>> E.g.:
>> 
>> 
>> - On the screen you see: “The red car was behind the house."
>> 
>> - The copy/paste gives: “Theredcarwasbehindthehouse.”
>> 
>> I found a PDF file produced by InDesign, and with that file the problem is
>> not there.
>> 
>> After analyzing with Acrobat the fonts embedded in the PDF files, I noticed:
>> 
>> 
>> - Indesign: fonts contain the  (code 20 in hexa, 32 in decimal).
>> 
>> - Scribus: fonts does not contain the  (code 20 in hexa, 32 in
>> decimal).
>> 
>> I am using PDFTron to convert PDF files to ePub files. When I use the
>> pdf2htmlEX tool (available for Linux and Windows), the problem is not there.
>> 
>> It seems that PDFTron will only insert a space in the text when the code 32
>> is in the text.
>> 
>> How comes there is no spaces with code 32 in the PDF produced by Scribus?
>> 
>> I know there is a lot of different spaces: U+0020 SPACE, U+00A0 NO-BREAK
>> SPACE, U+2000 EN QUAD 1 en (= 1/2 em), U+2001 EM QUAD 1 em, etc.
>> 
> 
> It may be a bit more complex than you think.
> The first question is, where are you copying from? I presume you mean
> highlighting text, then doing Ctrl+C or some equivalent. You might be
> better off trying to use the PDF viewer to extract the text.
> 
> Next, what encoding system are you using? Scribus uses UTF-8, but some
> other piece of software might use something else.
> 
> I just tried this in Fedora, by opening a Scribus-generated PDF in Adobe
> Reader, highlighting text, copying then pasting to a text editor (in
> this case Emacs), and saw all the spaces as I'd expect.
> 
> Greg

I made a test document with a few lines of text in a text frame and then used File->Export->Save as PDF and disassembled the resulting PDF.

The PDF seemed to place each letter individually, which is typical for applications that do high quality microjustification.

The issue might be not that the space character is something other than ascii 32 but that there are no space characters at all because each word is placed with a PDF "m" (moveto) operator.

William


 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20141213/18961ff6/attachment.html>


More information about the scribus mailing list