The footer of the document generated is not accessible. Link in the footer is not read by screen readers.
00000149_Version_2-1 (1).pdf (113.2 KB)
Font accessible file.docx (108.8 KB)
The footer of the document generated is not accessible. Link in the footer is not read by screen readers.
00000149_Version_2-1 (1).pdf (113.2 KB)
Font accessible file.docx (108.8 KB)
Could you please share following details and we’ll investigate this issue:
Please share the conversion code as well.
Could you please tell which screen reader you are using? Link in the footer is readable for both files when opened in respective native applications image.png (18.7 KB).
Also, please specify if you are trying to convert a Word document to PDF or vice versa.
import com.groupdocs.conversion.Converter;
import com.groupdocs.conversion.ConverterSettings;
import com.groupdocs.conversion.contracts.ConverterSettingsProvider;
import com.groupdocs.conversion.contracts.documentinfo.IDocumentInfo;
import com.groupdocs.conversion.internal.c.a.w.FolderFontSource;
import com.groupdocs.conversion.internal.c.a.w.FontSourceBase;
import com.groupdocs.conversion.internal.c.a.w.SystemFontSource;
import com.groupdocs.conversion.internal.c.a.w.FontSettings;
import com.groupdocs.conversion.options.convert.PdfConvertOptions;
import com.groupdocs.conversion.options.convert.PdfDocumentInfo;
import com.groupdocs.conversion.options.convert.PdfOptions;
import com.groupdocs.conversion.options.load.WordProcessingLoadOptions;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import static jdk.xml.internal.SecuritySupport.getClassLoader;
public class Main {
public static void main(String[] args) {
System.out.println(“Hi”);
String filePath = “templateGDocs.docx”; // Replace with your file path
String outputFilePath = “output.pdf”;
try {
// Create a File object
File file = new File(filePath);
String userHome = System.getProperty("user.home");
String outputFilePathString = userHome + File.separator + "outputfile.docx";
System.out.println(outputFilePathString);
// Open an InputStream for the file
try (InputStream inputStream = Main.class.getClassLoader().getResourceAsStream(filePath)) {
WordProcessingLoadOptions loadOptions = new WordProcessingLoadOptions();
// Below is required for adding Tags in the output PDF documnet
loadOptions.setPreserveDocumentStructure(true);
try (Converter converter = new Converter(() -> inputStream, () -> loadOptions)) {
try (ByteArrayOutputStream ms = new ByteArrayOutputStream()) {
PdfConvertOptions convertOptions = new PdfConvertOptions();
PdfOptions pdfOptions = convertOptions.getPdfOptions();
pdfOptions.getFormattingOptions().setDisplayDocTitle(true);
PdfDocumentInfo pdfDocumentInfo = pdfOptions.getDocumentInfo();
pdfDocumentInfo.setTitle("Test");
converter.convert(() -> ms, convertOptions);
byte[] outputPdfBytes = ms.toByteArray();
System.out.println("Generated PDF content size in bytes: " + outputPdfBytes.length);
try (FileOutputStream fileOutputStream = new FileOutputStream(outputFilePath)) {
fileOutputStream.write(outputPdfBytes);
System.out.println("File created successfully!");
} catch (IOException e) {
e.printStackTrace();
}
}
} catch (IOException e) {
System.out.println(e.getMessage());
throw e;
}
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}