I try to implement a one click save as PDF button
pdfButton_ = new JButton("PDF");
pdfButton_.setFocusable(false);
pdfButton_.setAlignmentX(LEFT_ALIGNMENT);
pdfButton_.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
CefPdfPrintSettings settings = new CefPdfPrintSettings();
// A4 page size
settings.page_width = 210000;
settings.page_height = 297000;
browser.printToPDF("/home/master/code/src/pdf/testy.pdf", settings, new CefPdfPrintCallback() {
@Override
public void onPdfPrintFinished(String path, boolean ok) {
}
});
}
});
However when I click it, I get this message:
[0527/153435.832646:ERROR:print_dialog_linux.cc(124)] Empty size value returned in GetPdfPaperSize; PDF printing will fail.
The default print to PDF in the menuBar of the detailed sample app works. How can this be?