tudor Posted February 16, 2023 Posted February 16, 2023 When opening a PDF exported from Affinity using other apps, the space characters are all gone. They are rendered visually by increasing the spacing ("tracking") between last/first characters of each word. I was able to replicate this bug by opening an Affinity PDF in Illustrator, Inkscape, CorelDraw, and Sketch, all on macOS. I've had this issue only with PDFs generated by Affinity, so it's definitely an issue with the Affinity apps and/or PDFlib. This issue is important because it affects the way we can exchange files with people who don't use Affinity apps. Until now, opening an Affinity PDF in other apps seemed like a good enough solution whenever I needed to convert an .afdesign file to .ai or something else. This bug makes it very difficult to exchange files containing more than a few sentences of text, without manually reformatting the text. Please fix it. Quote
Staff Pauls Posted February 16, 2023 Staff Posted February 16, 2023 try disabling font subsetting when generating the PDF's. If you could provide a sample document and any related fonts we can look into the issue in more detail Quote
tudor Posted February 16, 2023 Author Posted February 16, 2023 27 minutes ago, Pauls said: try disabling font subsetting when generating the PDF's. Disabling font subsetting did not help. I've attached the afpub file I used for testing. It contains one sentence typed using Arial. Here is a screenshot showing the issue when opening the Affinity PDF in Adobe Illustrator. I added the first line of text in Illustrator, to show the true spaces vs. fake ones. affinity space issue.afpub Quote
MickRose Posted February 16, 2023 Posted February 16, 2023 It seems to be because it is Artistic Text rather than Frame Text. I can sort of see why this happens. Pauls 1 Quote Windows 10 Pro, I5 3.3G PC 16G RAM
tudor Posted February 16, 2023 Author Posted February 16, 2023 3 hours ago, MickRose said: It seems to be because it is Artistic Text rather than Frame Text. I can sort of see why this happens. Frame text has the same issue. Quote
MikeTO Posted February 16, 2023 Posted February 16, 2023 Could this just be an export settings issue? I opened your afpub file, exported it to PDF, and opened the file in Adobe Acrobat and Apple Preview. Both apps had spaces between the words. test.pdf Could you please share screenshots of your export to pdf settings? Thanks Quote Download a free PDF manual for Affinity Publisher 2.6 Download a quick reference chart for Affinity's Special Characters Affinity 2.6 for macOS Sequoia 15.5, MacBook Pro (M4 Pro) and iPad Air (M2)
tudor Posted February 17, 2023 Author Posted February 17, 2023 13 hours ago, MikeTO said: Could this just be an export settings issue? I opened your afpub file, exported it to PDF, and opened the file in Adobe Acrobat and Apple Preview. You need to open the PDF in an editing app, not in a viewer. Quote
MikeTO Posted February 17, 2023 Posted February 17, 2023 5 hours ago, tudor said: You need to open the PDF in an editing app, not in a viewer. If the other app removes the spaces then the problem is with their interpretation of the PDF. Quote Download a free PDF manual for Affinity Publisher 2.6 Download a quick reference chart for Affinity's Special Characters Affinity 2.6 for macOS Sequoia 15.5, MacBook Pro (M4 Pro) and iPad Air (M2)
tudor Posted February 17, 2023 Author Posted February 17, 2023 1 minute ago, MikeTO said: If the other app removes the spaces then the problem is with their interpretation of the PDF. This happens only with PDFs generated by Affinity apps. It's hard to believe that the four editing apps I tried, made by four different companies (one of them being Adobe) all have the same bug. Quote
tudor Posted February 17, 2023 Author Posted February 17, 2023 Adding a fifth editing app that I've just tried and was unable to interpret spaces in an Affinity PDF: QuarkXpress. Quote
tudor Posted February 17, 2023 Author Posted February 17, 2023 FWIW, I've searched the internet and found similar issues affecting various other applications that generate PDFs (not related to Affinity). In one discussion someone said this: "I had a long chat session with the Adobe help team yesterday. It seems that the problem arises when a document created in some other editor is saved as PDF this problem can arise resulting in spaces not appearing to be standard ones under ISO (or ASCII 32)." Quote
MikeTO Posted February 17, 2023 Posted February 17, 2023 3 minutes ago, tudor said: It seems that the problem arises when a document created in some other editor is saved as PDF this problem can arise resulting in spaces not appearing to be standard ones under ISO (or ASCII 32)." Apple Preview and Adobe Acrobat Reader both interpret the Affinity PDF spaces as U+0020 which are regular spaces, the same as ASCII 32. I also opened an Affinity PDF in PDF Expert and was able to edit it without problems, the spaces were interpreted as U+0020. If Apple Preview, Adobe Acrobat Reader, and PDF Expert can do this then Illustrator can do the same and the problem is with Illustrator. I know Adobe created the PDF format but PDF was intended for presentation and not editing and interpreting the text in a PDF to make it editable can be done in different ways. Tight tracking, word spacing, and leading can cause apps to make interpretation mistakes which is why Affinity includes a PDF import option to favour editable text at the cost of layout fidelity, which changes the judgments Affinity makes about the text. Illustrator lacks options to change its interpretation. Quote Download a free PDF manual for Affinity Publisher 2.6 Download a quick reference chart for Affinity's Special Characters Affinity 2.6 for macOS Sequoia 15.5, MacBook Pro (M4 Pro) and iPad Air (M2)
tudor Posted February 17, 2023 Author Posted February 17, 2023 This is how an online PDF analyser sees the content in my Affinity PDF file: Quote
tudor Posted February 17, 2023 Author Posted February 17, 2023 This article seems to explain the space issues in PDFs: https://blog.idrsolutions.com/how-are-text-spaces-created-in-a-pdf-file/ Quote
laurent32 Posted February 17, 2023 Posted February 17, 2023 Tried it too… I've got the spaces with : - PDF Toolkit+ - PDF to text - PDFify - PDF OCR X Community Edition But I don't with : - Vectornator - QuarkXpress : Once converted, no spaces characters, but look at the 55,6… Quote MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82) + 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + … Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026) MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345) Licence Universelle Affinity V2 updated to 2.3.0
MikeTO Posted February 17, 2023 Posted February 17, 2023 20 minutes ago, tudor said: This article seems to explain the space issues in PDFs: https://blog.idrsolutions.com/how-are-text-spaces-created-in-a-pdf-file/ This problem arises because a page layout program like Affinity is creating a PDF for printing and viewing accuracy, not for editing. PDF is a presentation format, not a file exchange format, so you won't always get perfect results and some programs are better at it than others. Just because Illustrator can't open it properly doesn't mean Affinity is doing anything incorrectly. Download PDF Expert (there's a free version) and you'll be able to open the file for editing without problems. You could resave from it and then try to edit it in Illustrator. Tom Lachecki and garrettm30 2 Quote Download a free PDF manual for Affinity Publisher 2.6 Download a quick reference chart for Affinity's Special Characters Affinity 2.6 for macOS Sequoia 15.5, MacBook Pro (M4 Pro) and iPad Air (M2)
laurent32 Posted February 17, 2023 Posted February 17, 2023 Yes, I agree @MikeTO, it depends of the app that opens the file. We could call it a PDF format bug… Same goes with diacritics characters, sometimes strangely coded with 2 signs, often in PDF files built via US or UK machines… Quote MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82) + 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + … Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026) MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345) Licence Universelle Affinity V2 updated to 2.3.0
tudor Posted February 17, 2023 Author Posted February 17, 2023 17 minutes ago, MikeTO said: Just because Illustrator can't open it properly doesn't mean Affinity is doing anything incorrectly. But it means that I can't use the PDF workaround to exchange files with users of other design apps, and eventually that's going to stop me from using Affinity apps altogether. Affinity could investigate and try fixing this or not, it's their choice. Pen&Ink 1 Quote
MikeTO Posted February 17, 2023 Posted February 17, 2023 PDF is never going to be a perfect format for exchanging files with Adobe users. I would far rather that Affinity produce PDFs that print exactly as I created them than create imperfect PDFs that are more editable in Illustrator. Pauls, Tom Lachecki, laurent32 and 1 other 4 Quote Download a free PDF manual for Affinity Publisher 2.6 Download a quick reference chart for Affinity's Special Characters Affinity 2.6 for macOS Sequoia 15.5, MacBook Pro (M4 Pro) and iPad Air (M2)
MikeW Posted February 17, 2023 Posted February 17, 2023 The Affinity pdf does not have the spaces encoded. Compare the two font reports attached. Mike Font report for test.pdf Font report for x-test.pdf tudor 1 Quote
laurent32 Posted February 17, 2023 Posted February 17, 2023 What I'd like to compare is the PDF created on a windows machine and the PDF created on a macOS machine… Both out of Affinity, with the same options. Are the PDFs identical ? Quote MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82) + 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + … Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026) MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345) Licence Universelle Affinity V2 updated to 2.3.0
tudor Posted February 17, 2023 Author Posted February 17, 2023 1 hour ago, MikeW said: The Affinity pdf does not have the spaces encoded. Bingo! Thank you for checking. Quote
kenmcd Posted February 17, 2023 Posted February 17, 2023 On 2/17/2023 at 6:29 AM, MikeW said: The Affinity pdf does not have the spaces encoded. Compare the two font reports attached. Mike Font report for test.pdf 30.66 kB · 12 downloads Font report for x-test.pdf 19.46 kB · 7 downloads Nice reports - I want it! (the app) I extracted the embedded font (a bit more low tech) from the test.pdf - and there is no space character in the font. Made the same doc in LibeOffice, exported to PDF, extracted the font - has a space character. When using Remap Characters in InFix or FlexiPDF - there is no space character to remap (not in the embedded font). Looking at the actual code in the PDF you can see the added whitespace (not a character). /GS0 gs /GS1 gs q 1 0 0 1 118.431 436.371 cm 0 0 0 1 k BT /F0 19 Tf 0 0 Td [ (\000\001) 0.2 (\000\002) -0.2 (\000\003) -278 The (\000\004) -0.2 (\000\005) -0.2 (\000\006) -0.2 (\000\007\000\010) -277.8 quick (\000\011) -0.2 (\000\012) -0.1 (\000\013) -0.2 (\000\014) -0.2 (\000\015) -278 brown (\000\016) 0.2 (\000\013) -0.2 (\000\017) -277.8 fox (\000\020) -0.2 (\000\005) -0.2 (\000\021) -0.1 (\000\022) -0.2 (\000\023) -277.8 jumps (\000\013) -0.2 (\000\024\000\003) -0.2 (\000\012) -277.8 over (\000\025) 0.2 (\000\002) -0.2 (\000\003) -278 the (\000\026) -0.2 (\000\027) -0.2 (\000\030\000\031) -277.8 lazy (\000\032) -0.2 (\000\013) -0.2 (\000\033) -0.2 dog ] TJ ET Q I added line breaks and the corresponding text on the right for clarity. The character references are in the parentheses (ref to the cmap). The "-278" is the whitespace after the "The". @tudor - note how that "278" corresponds to your image in your second post above. Each of the 27x numbers are whitespace gaps. All PDF editors are guessing at where to put actual spaces when they are not actually encoded. Some are better than others at this guessing. And justified text, and kerning, and tracking adjustments make the guessing harder. Affinity could make this easier by including actual spaces. tudor and MikeW 2 Quote
Staff Patrick Connor Posted March 1, 2023 Staff Posted March 1, 2023 I have discussed this matter with the developer involved, who says that despite the PDF Affinity exports having no actual spaces, that most applications reinterpret the spaces between characters that we output as spaces and disguise this as spaces seem to reappear in those applications. HOWEVER in the next beta we are making an attempt to change this and will start exporting spaces and tabs as such (if the font supports a fixed space). Once our next beta is released you could see if this change has improved things for you tudor, kenmcd, MikeW and 1 other 2 2 Quote Patrick Connor Serif Europe Ltd Latest V2 releases on each platform Help make our apps better by joining our beta program! "There is nothing noble in being superior to your fellow man. True nobility lies in being superior to your previous self." W. L. Sheldon
Staff Affinity Info Bot Posted March 7, 2023 Staff Posted March 7, 2023 The issue "PDF export does not output spaces" (REF: AFB-7405) has been fixed by the developers in internal build "2.1.0.1720". This fix should soon be available as a customer beta and is planned for inclusion in the next customer release. Customer beta builds are announced here and you can participate by following these instructions. If you still experience this problem once you are using that build version (or later) please reply to this thread including @Serif Info Bot to notify us. Quote
Recommended Posts
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.