Java PrinterJob auto-orientation

I have an PDF what i want to print labels with PrinterJob. The problem is that the result is moved about 90 degrees, the printer is an Bixolon SLP-DX223. In the driversettings i have changed the label size in the main and default settings but there is no change on the print. If i print the pdf with the Acrobat Reader and the same settings the result ist perfekt but not with the PrinterJob print.

try {
     PDDocument document = PDDocument.load(new File(file));
     PrintService myPrintService = findPrintService(printer);
     PrinterJob job = PrinterJob.getPrinterJob();

     job.setPageable(new PDFPageable(document, Orientation.PORTRAIT));
     job.setPrintService(myPrintService);
     job.setJobName(jobname);
     job.setCopies(copies);
     job.print();
     document.close();

} 
catch (PrinterException | IOException e) {
     e.printStackTrace();
}

Thanks for help

Answer

the answer from @GilbertLeBlanc brings me to the result, the size of the paper was not definied, so i have use the following code:

double labelWidth = 50.8;           //width in mm
double labelHeigth = 25.4;          //height in mm

labelWidth = labelWidth / 0.353;    //calculate size
labelHeight = labelHeight / 0.353;  //calculate size

Paper paper = new Paper();
paper.setSize(labelWidth, labelHeight);
paper.setImageableArea(0, 0, paper.getWidth(), paper.getHeight());
PageFormat pageFormat = new PageFormat();
pageFormat.setPaper(paper);

Book book = new Book();
book.append(new PDFPrintable(document), pageFormat, document.getNumberOfPages());

job.setPageable(book);              //job is the printerjob