Table in pdf, generated from Asciidoctor have word wrapping but the word becomes unsearchable

36 Views Asked by At

I have the following table in Adoc which is generated by swagger annotation of java APIs.

[options="header", cols=".^5a,.^5a,.^5a"]
|===
|Name|Description|Schema
|**secondaryBackendMnoProvisioningNotifEnabled** +
__optional__||boolean
|===

From the adoc a pdf doc is generated but the problem is the name of the parameter as defined in the first column in table below is getter word-wrap, I don't have any problem from the word getting wrapped as there is no width so in pdf the word will get wrapped. But the problem is that the word is also not searchable.

For example the pdf shows the word as

secondaryBackendMnoProvisioningNotifEnab
led

where the word is searchable in pdf as "secondaryBackendMnoProvisioningNotifEnab" but not on "secondaryBackendMnoProvisioningNotifEnabed".

But if the same table is generated by creating a word doc and converted to pdf the same gets wrapped but searchable using the whole word.

Suggest what property should be used if any, so that the word which is getting wrapped doesn't have "\n" kind of character which makes the word unsearchable.

1

There are 1 best solutions below

0
eskwayrd On

The problem is that when Prawn, the PDF generator Asciidoctor PDF uses, splits text to the next line, the text is no longer contiguous. Basic text searches cannot find the separated text.

As I commented earlier, you might try using inline monospace markup instead of boldface, which can help prevent text splitting.

However, you may have to adjust your table formatting to guarantee enough space for long endpoint/method/parameter names. PDFs are fixed in size and do not reflow text to accommodate the PDF reader size.