Jump to content
You must now use your email address to sign in [click for more info] ×

Ommiting spaces in PDF export


MDC1977

Recommended Posts

When exporting a project to PDF, the optical representation in the PDF ist correct, but spaces between words are now missing. This is an inacceptable behaviour, because the text should still be accecible completely in the PDF. A space is an invisible character, yet always part of the text. You can't just ommit parts of the content. And no, this should be completely independent from chosen font or anything.

Screenshot showing the final PDF top and the extracted Text from the PDF put back into Word below. You can see the missing space. Have several errors like this, especially in headlines.

Publisher 2.0.0, WIN 10, PDF export for digital usage (which makes searchability and usability of the text extremely important)

Publisher2_OmmitedSpaces.png

Link to comment
Share on other sites

Can you provide a sample .afpub file and an exported PDF that demonstrate this? That would help with the analysis.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

The spaces aren't missing in the PDF, as you said you can see them optically, it's just that when you ask Publisher to open the PDF it has decided that there aren't spaces there. This isn't a new issue in v2, it worked the same way in v1.

Publisher can interpret the narrow spaces between words as wider tracking for the last character in a word if you've set the tracking narrow. This screenshot shows a test with tracking set to -50. I re-opened the PDF and lost the spaces between some words on lines where the spacing between words is narrow. You can tell the spaces are missing due to the lack of dots between them as I have Show Special Characters on, but they look visually spaced. This is because while most of the text has tracking set to -50, the last character in each word has the tracking set to +86.8, Publisher interpreted the very narrow space between words as just wider tracking instead of as a space.

But don't worry about the accessibility of your PDF - the spaces are really there in the PDF. You can test this by opening the PDF in another app and copying the text to a text editor. The issue is only with re-opening a PDF into Publisher.

1697247924_Screenshot2022-12-13at10_07_44AM.thumb.png.0a3108e7a623b06cc6a331ae34eeec47.png

Download a free manual for Publisher 2.4 from this forum - expanded 300-page PDF

My system: Affinity 2.4.2 for macOS Sonoma 14.4.1, MacBook Pro 14" (M1 Pro)

Link to comment
Share on other sites

32 minutes ago, MikeTO said:

But don't worry about the accessibility of your PDF - the spaces are really there in the PDF. You can test this by opening the PDF in another app and copying the text to a text editor. The issue is only with re-opening a PDF into Publisher.

Thx Mike for taking the time to look into the issue. I did just that - copy the text to Word with the effect of some - not all - spaces being missing. Right now I don't even see a pattern like a specific combination of letters, that might force a strange way of behaviour through using open type ligatures. Anyway - If I manage (whole family is sick right now), I extract one page with this error later.

Link to comment
Share on other sites

16 minutes ago, MDC1977 said:

I did just that - copy the text to Word with the effect of some - not all - spaces being missing.

But what app did you use to open the PDF. Note that Mike said to use a different app to Open it, that is, not one of the Affinity apps.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

1 hour ago, kenmcd said:

Still like to see the original PDF so we can examine what is actually in there (exactly what characters are present).

Try this. v1105 tracking & spaces.pdf

Opened in APub it's missing most space characters – while opened in a PDF viewer, then text export or copy/paste (to .txt or .rtf) does include all spaces as expected.

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

Here is the example page. Viewer used is Acrobat Reader - so the most common option people will use when accessing the PDF.
As far as I can tell, this seems to be a problem with the tracking, since the highlighted passages in the lower text have extra space within words, where there is no space in the original. Areas, which optically appear "tighter", miss spaces. Tracking is 0 though except for the highlighted passages in italics in the lower textblock (+50). Fonts original bought at MyFonts.

In the upper block there is two spaces missing between "Landtag MV keine". You have several missing spaces in the headline.

An extra space I find at the end of the lower textblock in "(historische)" as example (the one easiest to find in the text).

Exported as PDF digital high quality - with the standard settings delivered. Viewed with Acrobat Reader. Copy and paste into Word. You can reproduce the error with copying into Notepad as well. Using X4 with same result.

I know I can get a version looking good printed out of Affinity Publisher. Been there, done that.

But the customer also wants a digital version for the digital library. And this should also be flawless.

Example_Spacing_Errors.pdf

Link to comment
Share on other sites

1 hour ago, MDC1977 said:

An extra space I find at the end of the lower textblock in "(historische)" as example (the one easiest to find in the text).

Three more are in "eine r Mutte r rolle", one in "Familie und Be ruf". – Interestingly each of this five additional space characters (incl. "histo rische") seems to be related to the character "r".

Have you tried with a different font, or with left aligned instead of justified?

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

5 hours ago, MDC1977 said:

In the upper block there is two spaces missing between "Landtag MV keine". You have several missing spaces in the headline.

Took a quick look at the characters behind the text - and something is definitely wrong.
It looks like there are a lot of missing space characters.
Will have more time to look at it closer tomorrow.
 

Link to comment
Share on other sites

I opened the text in Xara Designer Pro and noticed that each space character has an exceptional positive kerning value as if width of 1 zero-width space having kerning factors like 195 ems/1000 etc. [with a trailing character]:

As the font is embedded by PDFLib, this really seems to be partly an export issue, and of course also import issue, if Publisher cannot read what it has initially written. Publisher shows absurd tracking and kerning values for all imported text from this file. But what could be the reason to encode spaces this way, in the first place [EDIT: Or perhaps full justification is always created this way when producing a PDF]?

UPDATE: Opening in Xara some other PDF files shows similarly handled spacing in all files, so this indeed seems to be the way spacing is achieved when embedding fonts. When opening these files in Publisher, they show standard ("automatic") kerning and tracking values so it seems that for some files mapping of embedded fonts to installed ones, and conversion of PDF spacing to standard spacing just fails. 

Link to comment
Share on other sites

Opening a PDF for editing requires any application to make guesses about the text flow.
Advanced PDF editors are generally better at these guesses than graphics applications.
And some graphics applications are better at guessing than other graphics applications.
Justification and tracking adjustments make that guess that much harder.

I opened the PDF in several PDF editors and readers.
PDF-XChange Editor, Foxit Reader, Master PDF Editor, Infix PDF Editor, FlexiPDF Editor, PixelPlanet PDFEditor, and Nitro Pro.
And then tested copying the heading and other text.
For the most part it looked fine.
All of them showed all the spaces in the heading - with the exception of Master PDF Editor which missed one space.
Foxit Reader did show an extra space in the "Ber uf damit oft als" text.
Mostly they were correct with a few different exceptions in different applications.
They all guessed a bit differently.

All of these applications have to guess at the proper text flow.
I think Adobe Reader just had a hard time with this justified text.
And perhaps how the spaces were created.
Usually in Infix and FlexiPDF, I can highlight characters and then right-click, select Remap Characters - and that shows me some info on how it was embedded.
But in this PDF, the space characters show a message that says "the selected characters are from the control font and cannot be remapped."
I am not sure what that means (first time I have seen this), but apparently Adobe Reader does not handle this well.
My system is Adobe-free so I cannot test Adobe Reader.

Just to test ...
Try removing the justification and any tracking adjustments on the text and then export that page to PDF again.
That may enable editors/readers/graphics apps to guess better.
It would be interesting to see if that helps.

Link to comment
Share on other sites

Thx Ken for taking the time to look into it. When aligning things to the left and removing the tracking from the emphasized parts it reduces the missing spaces to a clear pattern: in front of W. Headline still remains an issue though - guess the bold type is causing the headache there. See the attached file.

Nonetheless: While all projects I've done so far (in the 1.X versions though) look great in print and I never had the slightest issue with the print shops, anybody working with Affinity regularly will come across the demand of a web-ready PDF of that same project, that is small and accessible. And this demand is independent from working on a paid project for a customer or doing the new flyer for the elementary school of your children. So the PDF-export of Publisher being enabled to serve that demand as well will be crucial to its long term success.

Thank you to everybody who took the time to look into this issue. I wish you all a merry and festive season 🤗

Spacing_left.pdf

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.