public static void main(String[] args) throws IOException
    {
        if( args.length != 2 )
        {
            System.err.println("usage: " + HelloWorld.class.getName() + " <output-file> <Message>");
            System.exit(1);
        }

        String filename = args[0];
        String message = args[1];
        
        try (PDDocument doc = new PDDocument())
        {
            PDPage page = new PDPage();
            doc.addPage(page);
            
            PDFont font = new PDType1Font(FontName.HELVETICA_BOLD);

            try (PDPageContentStream contents = new PDPageContentStream(doc, page))
            {
                contents.beginText();
                contents.setFont(font, 12);
                contents.newLineAtOffset(100, 700);
                contents.showText(message);
                contents.endText();
            }
            
            doc.save(filename);
        }
    }
@Test
    void testHelloWorldTTF() throws IOException
    {
        String outputFile = OUTPUT_DIR + "/HelloWorldTTF.pdf";
        String message = "HelloWorldTTF.pdf";
        String fontFile = "../pdfbox/src/main/resources/org/apache/pdfbox/resources/ttf/LiberationSans-Regular.ttf";

        new File(outputFile).delete();

        String[] args = { outputFile, message, fontFile };
        HelloWorldTTF.main(args);

        checkOutputFile(outputFile, message);

        new File(outputFile).delete();
    }