I need printer that prints to PDF files. I have application that automatically searches some text in printed PDF file so printed PDF files have to be searchable.
As I wrote I need PDF printer because I print from Java Application that prints only on printers. I mean that any command line tool that converts txt files or any other format to PDF does not meet my requirements. My application does not execute any command, my application prints on indicated system printer so I need printer.
I know that cups-pdf is mostly recommended and used. There is one big problem with cups-pdf. Cups-pdf prints to PDF files whose text can not be searched or copied. I spent a lot of time trying to configure cups-pdf to fix this problem, unfortunately without success.
I have tried to install BullZip printer using Wine, also without success.
I also tried Generic PDF Printer from cups filters. I mean following printer:
lpadmin -p gpdf -v file:///cups/prints/generic_pdf.pdf -E -m lsb/usr/cupsfilters/Generic-PDF_Printer-PDF.ppd
Copied and pasted text looks differently than text from cups-pdf but it is also garbled. Search does not work.
I also tried to print do PS file and convert PS file to PDF file in postprocessing. I noticed that printing to PS file is lossy. I described it in What PS driver to use with cups-pdf? question.
I cannot find any other PDF printer.
I can't believe there's no virtual PDF printer on Linux that prints to PDF files whose text can be searched or copied.
Is there any PDF printer that meets my requirements?
EDIT
My question differs from How to install a "pdf printer"? question in my opinion. The main difference is that I need PDF whose text can be searched. Answer that has the most point advices using cups-pdf. cups-pdf works in general for me, it prints to PDF file but text can not be searched or copied so it does not meet my requirements. The second answer that advices using 'Print to file" option also does not meet my requirements because I need system printer.
I have java application that prints on real physical printers. I have integration tests that prints on virtual PDF printers but it works only on Windows OS. I would like execute integration tests in docker and I need system printer.