AntennaHouse / pdf5-ml

Antenna House PDF5-ML DITA-OT Plug-in
23 stars 9 forks source link

Preserving codeblock line breaks in PDF output #178

Closed steinbacher01 closed 3 years ago

steinbacher01 commented 3 years ago

Is there a way to preserve codeblock line breaks when copying code from PDF output?

Since there is a limited amount of space in each line, sometimes a code string will wrap into the line below it. Copying and pasting the code from the PDF into a command line will retain these unwanted line breaks.

Is there a way to somehow preserve the original linebreaks within the codeblock element so that copying and pasting from the PDF will maintain the original code string?

Example codeblock:

{ n=6; echo "- name: eiselk" | sed ':lbl; /^ {'$n'}/! {s/^/ /;b lbl}' n=8; echo "helm_override_values:" | sed ':lbl; /^ {'$n'}/! {s/^/ /;b lbl}' n=10; echo "ehl-logstash:" | sed ':lbl; /^ {'$n'}/! {s/^/ /;b lbl}' n=12; echo "config:" | sed ':lbl; /^ {'$n'}/! {s/^/ /;b lbl}' n=14; echo "queue.checkpoint.writes: 1024" | sed ':lbl; /^ {'$n'}/! {s/^/ /;b lbl}' n=14; echo "queue.max_bytes: 128mb" | sed ':lbl; /^ {'$n'}/! {s/^/ /;b lbl}' n=4; echo "ees-security-idam:" | sed ':lbl; /^ {'$n'}/! {s/^/ /;b lbl}' n=6; echo "app_configs:" | sed ':lbl; /^ {'$n'}/! {s/^/ /;b lbl}' n=6; echo "- name: eis-wso2" | sed ':lbl; /^ {'$n'}/! {s/^/ /;b lbl}' n=8; echo "helm_override_values:" | sed ':lbl; /^ {'$n'}/! {s/^/ /;b lbl}' n=10; echo "probes:" | sed ':lbl; /^ {'$n'}/! {s/^/ /;b lbl}' n=12; echo "initialDelay: 480" | sed ':lbl; /^ {'$n'}/! {s/^/ /;b lbl}'

Published PDF:

codeblock

I can provide sample source files if needed.

Thanks,

Leroy Steinbacher

ToshihikoMakita commented 3 years ago

I don't know PDF so much, but it is bunch of the drawing instructions and does not hold the logical structure of the original document. Even the line-break code does not exists in PDF. So my guess it that it is impossible.

steinbacher01 commented 3 years ago

OK, thanks for the response.