@Override
public boolean run(
)
{
// 1. Opening the PDF file...
File file;
{
String filePath = promptPdfFileChoice("Please select a PDF file");
try
{file = new File(filePath);}
catch(Exception e)
{throw new RuntimeException(filePath + " file access error.",e);}
}
// 2. Iterating through the indirect objects to discover existing unicode mapping (ToUnicode) streams to edit...
/*
NOTE: For the sake of simplicity, I assume that all font objects
tipically reside in distinct indirect objects.
*/
for(PdfIndirectObject indirectObject : file.getIndirectObjects())
{
/*
NOTE: In order to get the unicode mapping stream we have to get
its corresponding font object, which is a dictionary.
*/