Marielw Posted August 20, 2023 Share Posted August 20, 2023 I'm using publisher to create a newsletter which needs links to sections of a website. I'm not trying to create hyperlinks. Some of these links are long and need to be broken to go over more than one line. The links can be copied and pasted from Publisher with no issue, but once exported to PDF then copied and pasted, a space is added at the end of each line which creates a 404 error when copied to a browser. There are no hidden special characters and it does it if I use a soft return or not. I just need text that the reader can copy and paste to go to the required page regardless of how long the url is. I've attaches a sample Link example.pdf Quote Link to comment Share on other sites More sharing options...
GarryP Posted August 20, 2023 Share Posted August 20, 2023 Welcome to the forums @Marielw I’ve just tried copying the URL text from your example document (when viewing it in Firefox) and pasting it into a text editor. I didn’t get any extra space at the end, and using Paste and Go (Firefox bar) got me to the web page as expected. However, selecting the text and then right-clicking and trying “Go to…” caused a 404 error because at least one space was inserted into the URL (before “adelaide”). On the other hand, I’ve just tried my own long URL text in a PDF and the URL works just fine either by clicking on it, or copy/paste-into-browser-bar, or right-click-Go. Are you sure you didn’t add a new line separator? Would you be able to share the original document (AFPUB) so we can look at it. In lieu of a solution to this my recommendation would be to use a URL shortening service to create shorter URLs. Marielw 1 Quote Link to comment Share on other sites More sharing options...
thomaso Posted August 20, 2023 Share Posted August 20, 2023 It may depend on you PDF viewer app. Different to you and @Garry P I can use your PDF within a browser window to get linked directly to the target without error. pdf-URL.m4v Also Acrobat doesn't display a space character in your PDF. Marielw 1 Quote macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1 Link to comment Share on other sites More sharing options...
Marielw Posted August 20, 2023 Author Share Posted August 20, 2023 Thanks GarryP, The error was picked up by my proofreader so they were getting the error too. I appreciate your suggestion on using a shortened url and have added shortened versions to the document to get it resolved for now. As this is going to be an ongoing issue I'm still hoping to work out why it is doing it. I've created a mock file with examples. It occurs when I copy and past the url from the pdf into a browser. It puts a space before adelaide. Adding space example.afpub Adding space example.pdf Quote Link to comment Share on other sites More sharing options...
Hangman Posted August 20, 2023 Share Posted August 20, 2023 9 minutes ago, Marielw said: It occurs when I copy and past the url from the pdf into a browser. It puts a space before adelaide. For me this is Browser specific, Safari includes the space when the link is copied from the pdf and pasted into the browser resulting in the 404 error but both Firefox and Chrome seem to automatically remove the space and take you to the correct page but clicking the link in the pdf where it appears over two lines also only reads the first line and subsequently errors in all browsers... Quote Affinity Designer 2.5.5 | Affinity Photo 2.5.5 | Affinity Publisher 2.5.5 Affinity Designer Beta 2.6.0.2861 | Affinity Photo Beta 2.6.0.2861 | Affinity Publisher Beta 2.6.0.2861 MacBook Pro M3 Max, 36 GB Unified Memory, macOS Sonoma 14.6.1, Magic Mouse HP ENVY x360, 8 GB RAM, AMD Ryzen 5 2500U, Windows 10 Home, Logitech Mouse Link to comment Share on other sites More sharing options...
thomaso Posted August 20, 2023 Share Posted August 20, 2023 (edited) 21 minutes ago, Marielw said: when I copy and past the url from the pdf into a browser. It puts a space before adelaide. Again it seems to depend on the PDF reading app. Even with your manual line break it works to me via copy/paste: pdf url line break.m4v EDIT: I can confirm @Hangman's experience: Safari adds a space before the first character of the second line and thus results in an error. Edited August 20, 2023 by thomaso Quote macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1 Link to comment Share on other sites More sharing options...
walt.farrell Posted August 20, 2023 Share Posted August 20, 2023 13 minutes ago, Hangman said: but clicking the link in the pdf where it appears over two lines also only reads the first line and subsequently errors in all browsers... What application are you using to view the PDF? Quote -- 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 More sharing options...
Marielw Posted August 20, 2023 Author Share Posted August 20, 2023 (edited) Screen cap from my machine. This is viewing in preview. It did the same thing on my husbands computer using Acrobat Screen Recording 2023-08-20 at 8.42.42 pm.mov Edited August 20, 2023 by Marielw Quote Link to comment Share on other sites More sharing options...
David in Яuislip Posted August 20, 2023 Share Posted August 20, 2023 37 minutes ago, thomaso said: It may depend on you PDF viewer app. Yep, that appears to be the issue I've created a pdf in Word, opened it in Chrome and there are additional spaces so neither Go To or copy/paste work Link-Word.pdf Quote Microsoft Windows 11 Home, Intel i7-1360P 2.20 GHz, 32 GB RAM, 1TB SSD, Intel Iris Xe Affinity Photo - 24/05/20, Affinity Publisher - 06/12/20, KTM Superduke - 27/09/10 Link to comment Share on other sites More sharing options...
thomaso Posted August 20, 2023 Share Posted August 20, 2023 (edited) 32 minutes ago, Marielw said: This is viewing in preview. It did the same thing on my husbands computer using Acrobat With copy/paste I can confirm the added space character for Preview … but not for Acrobat. Whereas when clicking the link in Acrobat it results in an error because the used URL is incomplete / contains the first line of text only, regardless of whether I click your two-line sample with or without your manual line break. I think the workaround for possibly every PDF reader or browser would be to additionally create in Affinity a hyperlink on the entire text. Then it works with click in Preview, too, regardless of a manual line break. v1105 hyperlink versions.pdf Edited August 20, 2023 by thomaso attachments added Quote macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1 Link to comment Share on other sites More sharing options...
Hangman Posted August 20, 2023 Share Posted August 20, 2023 18 minutes ago, walt.farrell said: What application are you using to view the PDF? Acrobat Reader, Foxit PDF Reader and Apple Preview all exhibit the same issue... walt.farrell 1 Quote Affinity Designer 2.5.5 | Affinity Photo 2.5.5 | Affinity Publisher 2.5.5 Affinity Designer Beta 2.6.0.2861 | Affinity Photo Beta 2.6.0.2861 | Affinity Publisher Beta 2.6.0.2861 MacBook Pro M3 Max, 36 GB Unified Memory, macOS Sonoma 14.6.1, Magic Mouse HP ENVY x360, 8 GB RAM, AMD Ryzen 5 2500U, Windows 10 Home, Logitech Mouse Link to comment Share on other sites More sharing options...
v_kyr Posted August 20, 2023 Share Posted August 20, 2023 Well in serious papers, such over several lines wrapped URL links do optical always look strange, without any follow line break flow individual glyph indicators ... Such indicators are also good usable for typing in commands which may go over several lines ... Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2 Link to comment Share on other sites More sharing options...
Hangman Posted August 21, 2023 Share Posted August 21, 2023 So, after a lot of digging, I discovered something interesting, "Microsoft uses Apple's algorithm for creating "Best for printing" PDFs, but Apple's algorithm does not include processing for URLs. MS also created a "best for electronic distribution" service to handle URLs correctly, but it only works with the subset of fonts that come with Microsoft Office." Having tested this, it only appears to work in Acrobat Reader and only when you turn off 'Create Links from URLs' in the General Preferences (which is on by default). The same PDF doesn't work in Foxit PDF Reader or PDF Studio even when 'Create Links from URLs' is disabled and it doesn't work in Apple Preview which doesn't have that preference. Attached is a pdf file created in Microsoft Word using Times New Roman, note how Microsoft Word handles the URLs, it auto breaks words in the URL without the addition of any hard or soft returns. If you select any of the multiline URLs from the MS Word pdf in Acrobat Reader (ensuring, 'Create Links from URLs' in the General Preferences if disabled) copy them and paste them into any browser, the URL is correctly recognised, this works in Chrome, Firefox and Safari (on Mac). Also attached are two additional pdf files created in Apple Pages and Google Docs, note how the line breaks only fall after either a hyphen or a '/', individual words are not split across multiple lines, again, there are no hard or soft returns. Subsequently copying the multiline URLs from either the pdf file generated in Apple Pages or Google Docs results in the loss of line-ending hyphens and the addition of line-ending spaces when pasted into a browser and a 404 error with Safari behaving differently to both Chrome and Firefox... Original URLhttps://www.theguardian.com/film/2023/aug/20/adele-exarchopoulos-actor-passages-interview-whishaw-blue-warmest-colour How it appears in Safarihttps://www.theguardian.com/film/%202023/aug/20/adele-exarchopoulosactor-%20passages-interview-whishawblue-%20warmest-colour How it appears in Chrome and Firefoxhttps://www.theguardian.com/film/2023/aug/20/adele-exarchopoulosactor-passages-interview-whishawblue-warmest-colour MS Word Source.pdf Apple Pages Source.pdf Google Docs Source.pdf Dan C 1 Quote Affinity Designer 2.5.5 | Affinity Photo 2.5.5 | Affinity Publisher 2.5.5 Affinity Designer Beta 2.6.0.2861 | Affinity Photo Beta 2.6.0.2861 | Affinity Publisher Beta 2.6.0.2861 MacBook Pro M3 Max, 36 GB Unified Memory, macOS Sonoma 14.6.1, Magic Mouse HP ENVY x360, 8 GB RAM, AMD Ryzen 5 2500U, Windows 10 Home, Logitech Mouse Link to comment Share on other sites More sharing options...
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.