Java Conversion to PDF from text and CSV file do not generate PDF document

For some TXT and CSV files (mostly small files) conversions to PDF without LoadOptions do not generate PDF document. Generated output contains input file content - it’s not PDF document.
Adding to converter CsvLoadOptions/TxtLoadOptions objects resolve problem

OS: Windows 11 Pro (22H2)
JAVA: Eclipse Temurin / Adoptium. jdk-17.0.8.1+1
GroupDocs Conversion: 23.10
test-files.zip (305 Bytes)

Source code:

import com.groupdocs.conversion.Converter;
import com.groupdocs.conversion.licensing.License;
import com.groupdocs.conversion.options.convert.PdfConvertOptions;
import com.groupdocs.conversion.options.load.CsvLoadOptions;
import com.groupdocs.conversion.options.load.TxtLoadOptions;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import lombok.val;

public class TxtCsvConversionSample {
  public static void main(String[] args) throws Exception {
    val licenseFile = new File(args[0]);
    val csvFile = new File(args[1]);
    val txtFile = new File(args[2]);

    val convertDocLicense = new License();
    convertDocLicense.setLicense(new FileInputStream(licenseFile));

    val csvLoadOptions = new CsvLoadOptions();
    val txtLoadOptions = new TxtLoadOptions();

    val convertOptions = new PdfConvertOptions();

    val csv1InputStream = new FileInputStream(csvFile);
    val csv2InputStream = new FileInputStream(csvFile);
    val csvOkOutputStream = new FileOutputStream("csv2pdf-ok.pdf");
    val csvErrorOutputStream = new FileOutputStream("csv2pdf-error.pdf");

    val csvWithOptionsConverter = new Converter(() -> csv1InputStream, () -> csvLoadOptions);
    csvWithOptionsConverter.convert(() -> csvOkOutputStream, convertOptions);

    val csvWithoutOptionsConverter = new Converter(() -> csv2InputStream);
    csvWithoutOptionsConverter.convert(() -> csvErrorOutputStream, convertOptions);

    val txt1InputStream = new FileInputStream(txtFile);
    val txt2InputStream = new FileInputStream(txtFile);
    val txtOkOutputStream = new FileOutputStream("txt2pdf-ok.pdf");
    val txtErrorOutputStream = new FileOutputStream("txt2pdf-error.pdf");

    val txtWithOptionsConverter = new Converter(() -> txt1InputStream, () -> txtLoadOptions);
    txtWithOptionsConverter.convert(() -> txtOkOutputStream, convertOptions);

    val txtWithoutOptionsConverter = new Converter(() -> txt2InputStream);
    txtWithoutOptionsConverter.convert(() -> txtErrorOutputStream, convertOptions);
  }
}

@mariusz.laciak

Does it not generate the PDF at all? Do you face any issue/error?

Could you please share more details on this? Please share the resultant PDF (if you get any).

GroupDocs for this small txt/csv files without TxtLoadOptions/CsvLoadOptions config generate output without any error. Generated output is binary equal to input file - is text file, not PDF.
You could run example code with attached sample files to recreate errors.

Result file with error is the same file as input file, so attaching it is unnecessary. Input test files are already included.

@mariusz.laciak
Thanks for sharing additional details. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CONVERSIONJAVA-2142

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.