Replies: 1 comment
-
I tried doing it myself using Python and bash. The logic had gap becuase of the way the text gets copied from pdf so i can't maintain a good formatting the way i want while copying multiple paragraps so i will just stick to normal 1 paragraph formatting. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Reference : Copy Text from pdf without line breaks
When Copying text from pdf,
\n
charcter is there on every line end. Then i have to remove them manually. I make notes in Anki by copying text from pdf.My System : ArchLinux, DE: Plasma, Wayland.
Currently i was using this, but the limitation was i cannot copy two or more paragraph at once as this function will merge all those paragraphs. So i was looking to improve it.
I found this regex
modifiedText = text.replace(/(?<!\.)\n/g, ' ')
but it is not working.Idea behind this was if
\n is followed by full-stop(.) then it won't touch it otherwise it will replace \n with space
.Beta Was this translation helpful? Give feedback.
All reactions