Copy link to clipboard
Copied
Hello all,
I'm documenting some lines of code that are intended to be copied and pasted out of the PDF into a Linux System or Notepad, but for some reason the pasted text deletes some of the hyphens found in the code when they appear at the end of a line. I've troubleshooted with different fonts, edited the type of hyphen used, and tried every relevant preference I could think of in Acrobat, but nothing has proved successful in retaining these end-of-line hyphens.
Any idea why this is happening or a solution to keeping the hyphens in the text if they fall at the end of the line?
I'm using Adobe Acrobat Pro DC. The document I spun the PDF from was written in Framemaker.
Thanks for your help!
That's actually a good thing. End-of-line hyphens are used in the DTP process to break up a word that can't be fit into the line, while keeping the spacing of all the lines equal. For example:
This is a very long sen-
tence, where the last
word is broken up.
They are not actually a part of the word, as opposed to hyphenated words, and therefore the PDF format provides a special flag that allows the creating application to insert them without it screwing up the text if it's exported to another format
...Copy link to clipboard
Copied
That's actually a good thing. End-of-line hyphens are used in the DTP process to break up a word that can't be fit into the line, while keeping the spacing of all the lines equal. For example:
This is a very long sen-
tence, where the last
word is broken up.
They are not actually a part of the word, as opposed to hyphenated words, and therefore the PDF format provides a special flag that allows the creating application to insert them without it screwing up the text if it's exported to another format.
You wouldn't want the text above to come out like this, would you?
This is a very long sen-tence, where the last word is broken up.
If this flag was used incorrectly then that needs to be solved in the original application (FrameMaker). I don't believe you can do it in Acrobat itself.
Copy link to clipboard
Copied
You have discovered something that has been proved true over and over for the last 20 years ago: PDF files are for reading and printing, not distributing things for reuse. Copy and paste is not likely to give exact results, and if there's anything code needs, it's exactness. Suggest that if you are serious about distributing code with your PDF, you include it as attachments, or as an accompanying ZIP.
Bear in mind that most people no longer use Reader to read PDF files, and each PDF viewer has its own quirks. Many will not show attachments so this is a less attractive solution than it once was.
Copy link to clipboard
Copied
Is a solution available to this? We have encountered the same problem and this is leading to serious issues as the user is not able to complete installation, which resulted in several bugs for the team to fix. Thanks.
Copy link to clipboard
Copied
I don't understand how your problem "user is not able to complete installation" relates to the original problem "PDF is not a good way to distribute code for exact copy/paste". Please explain.
Copy link to clipboard
Copied
User is trying to copy the installation command text from the installation guide which is in PDF format. So, when the text is pasted in command prompt, wherever hyphens are inserted and they appear at the end of the line get removed. Due to this, the installation is failing. See the example below. In this the text in bold was abcd-user in PDF, but when copied to Notepad, the hyphen was removed.
./abcdefg abcd-base-1.0.8-offline.tgz --offline --xpush --upgrade --retry
9 --retrywait 700 --abcd abcdefg-pos --executeABxyza --wait --xyz ./xyz
--f /abcd/abcde-user/xyza/abcd_xyzabase.tll /abcd/abcde-user/xyza/ABCDEFxyza.
aem /abcd/abcde-user/xyza/ABCDEF-xyza.axx /abcd --abcd.xyz --a/abcdeuser/
abcd/xyza_configabc_values.config /abcd/abcde-user/abcd-user --abcd/
abcd_configxyz_values.config --output abcd-yyza/install --id abcd-base
Copy link to clipboard
Copied
Yes, as I said, PDF is a really terrible way to distribute exact text for reuse. For commands, it's potentially catastrophic if you end up with a damaging command from inaccurate copies. I know you want PDF to be suitable but it just isn't. Even if Adobe changed something (and BROKE copy/paste for everyone who expects hyphens to be deleted) there would be no change to Chrome, Preview, Firefox, Edge, Safari and the countless other PDF viewers now in use. If you really must do that, you could try careful formatting and escapes:
./abcdefg abcd-base-1.0.8-offline.tgz --offline --xpush --upgrade \
--retry 9 --retrywait 700 --abcd abcdefg-pos --executeABxyza --wait \
--xyz ./xyz --etc --etc
But since the user may end up with spaces after the backslash, be sure to review and make sure that no bad things happen from the separate lines.
Copy link to clipboard
Copied
In fact, from your sample command, I'm guessing this is Unix... so no supported Adobe tech involved at all...
Copy link to clipboard
Copied
Thank you for responding. I tried "Copy with Formatting" option using Adobe Pro and it seems to work fine keeping the hyphen intact. But, the problem is, its available only in Pro and not in reader.