public static void exportPDF(final File pdfLaTeX, final File workingDir,
            final String problem, final String solution, final MainFrame mainFrame) {
        
        final java.util.Date date = new java.util.Date();
        final java.sql.Timestamp ts = new java.sql.Timestamp(date.getTime());
        final String timestamp = ts.toString().replaceAll(":", "-");
        
        final StringBuilder fileName = new StringBuilder();
        fileName.append(workingDir.getAbsolutePath()).append(File.separator);
        fileName.append("priklad ").append(timestamp).append(".tex");
        final File texFile = new File(fileName.toString());
        writeTeXFile(texFile, problem, solution);
        
        final String errorMsgHeader = "Chyba při exportu do PDF";
        final String errorMsg = "Překlad PDFLaTeXem zlyhal.";
        try {
            final JLRGenerator pdfGenerator = new JLRGenerator();
            pdfGenerator.deleteTempFiles(false, true, true); // leave .tex file
            if (pdfLaTeX == null) {
                if (pdfGenerator.generate(texFile, workingDir, workingDir))
                    JLROpener.open(pdfGenerator.getPDF());
            } else {
                if (pdfGenerator.generate(pdfLaTeX, 1, texFile, workingDir, workingDir)) 
                    JLROpener.open(pdfGenerator.getPDF());
            }
            
            if (!pdfGenerator.getErrorMessage().equals("No errors occurred!")) {
                UserInputChecker.error(mainFrame, errorMsgHeader, errorMsg);
                System.err.println(pdfGenerator.getErrorMessage());
            }
        } catch (IOException ex) {
            UserInputChecker.error(mainFrame, errorMsgHeader, errorMsg);
            System.err.println(ex.getMessage());
        }
    }