Jump to content

Publisher export PDF with letter spacing increased adds double spaces when copy/pasting.


Recommended Posts

When increasing the letter spacing of a text in publisher and then exporting to PDF if you copy - paste the text it will have extra spaces meaning if it is a link you copied it will not work unless you remove every space. Is there a way to work around this so i can maintain the visual aspect of the letter spacing while still having it copy with single spacing?

Link to comment
Share on other sites

What application are you Opening the PDF file in, and then doing the Copy/Paste of your text?

(And, out of curiosity, why Copy/Paste instead of just clicking on the link?)

Can you provide a sample .afpub file and the exported PDF?

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

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 18.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1

Link to comment
Share on other sites

Effectively, copying and pasting in a text editor from different PDF viewers (and also from the original file) resulted in various results:

Capturedcran2023-08-0701_41_15.png.f4f17708f0d7c81f4cf3f15a81813dd6.png

What seems strange to me is that Adobe Acrobat should be the most respectful of PDF standard. But here, there is clearly an unwanted behaviour… 

(I also re-exported a PDF from your .afpub file and it behaves the same way.)

 

BTW, @latimeriasdream, in your .afpub test file I didn't see any character spacing in the Position and transform fields, beside the automatic kerning between "Te"? What am I missing?

Affinity Suite 2.5 – Monterey 12.7.5 – MacBookPro 14" 2021 M1 Pro 16Go/1To

I apologise for any approximations in my English. It is not my mother tongue.

Link to comment
Share on other sites

@Outfi

Thanks for doing some testing, i dont have access to apple preview and was concerned how it would look there. I am using Paragraph > Justification > Desired Letter Spacing. I dont know much about PDF but it seems like there is some data in the PDF that lets some apps like acrobat know there is extra spacing whereas other apps cannot read this data and thus you get no spacing when copy pasting? If only there is some way to change this on export or maybe a 3rd party app.

Link to comment
Share on other sites

The issue lies with either the pdf library Serif uses or how it is used.

There is a "phantom space" between all but the /Te/ characters as shown in @Oufti screen shots. It is written in the pdf. Here's a screenshot that likely will not mean much to anyone.

On the left-hand pane, GID: 0 is the culprit. Technically, this invisible glyph is displayed by its bounding box dimensions--the box in the middle of the screen. The small dialog on the right shows this glyph as <0000> <FFFF> and uses a separate encoding to the viewable characters. The viewable characters, Testing, are highlighted in the red box at the bottom left.

Anyway, none of the other 3 layout applications display this behavior. In fact, I also placed the OP's pdf into each layout application along with my own test strings and all 3 applications corrected the issue in the OP's pdf.

Capture_001020.png.141585500698de095226ed9957aa28b8.png

Link to comment
Share on other sites

44 minutes ago, latimeriasdream said:

... are there any recommended workflows or tools for this?

Short of using a different layout application? Dunno.

I haven't tried seeing if Acrobat or pdfToolbox can re-export such a pdf and have it fix your sample. But even if it did, it would take much more testing to say with any degree of confidence they can repair all Affinity generated pdfs.

If someone else hasn't tried, I'll try in the morning. The computer has been turned off for the night. 

Link to comment
Share on other sites

Sorry for the delay. I couldn't figure out a means to actually remove the offending space characters using Acrobat or pdfToolbox. The only way I found was placing the pdf in ID or QXP and generating a new pdf.

Link to comment
Share on other sites

On 8/5/2023 at 3:29 PM, latimeriasdream said:

Is there a way to work around this so i can maintain the visual aspect of the letter spacing while still having it copy with single spacing?

Probably not.
All PDF readers/editors are guessing about spaces when copying text (or editing text).
There is no text "run" in a PDF.
It is a bunch of characters in boxes placed at coordinates on the page.
(you can see these coordinates in MikeW's image above in the lower left column).
Adjustments to tracking or justification make this guessing-the-spaces harder.

The image below is your PDF with your character spacing on the first line,
and I added a second line where I removed the Desired Letter Spacing adjustment.
The blue boxes are the Approximate Text Bounds for the various characters.
The empty box is an actual space character (new in v2.1).
test.edited.1.thumb.png.98148fa419438a8541af1a3223a4d8a3.png

That variable white space is what confuses the PDF readers/editors.
Some PDF readers/editors are better than others at guessing the correct real spaces.
As an example of this note the differences in Oufti's post above.
You will get different results in many different PDF readers/editors.

APub v2.1 made the guessing easier by adding actual space characters now (before this "spaces" were just additional white space which made the guessing actual real spaces that much harder).

Some PDF readers/editors, being aware of these problems, enable the user to affect how the guessing is done - for example below is a Preferences setting in PDF-XChange Editor (this is for editing):
Copy-White-Spaces-Mode.thumb.png.9ee2b93c930e4991f2a79a37fd123319.png

 

You cannot control what PDF reader the user is going to use.
What you can control is the letter spacing.
Do not use tracking or spacing adjustments.
Then the PDF reader has a much better chance of guessing actual spaces correctly.

If you are trying to affect the readability of small text by adding letter spacing,
use a better font which provides the correct optical size instead.

If you simply like "the look" - you are SOL.

Link to comment
Share on other sites

1 hour ago, kenmcd said:
On 8/6/2023 at 12:29 AM, latimeriasdream said:

Is there a way to work around this so i can maintain the visual aspect of the letter spacing while still having it copy with single spacing?

Probably not.
All PDF readers/editors are guessing about spaces when copying text (or editing text).

FWIW, in Acrobat I get two different results with copy/paste within the test.PDF depending on the used Acrobat tool:
(the first is tooltipped like "Select Text and Images", the second says "Edit original document text".)

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

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.