Create PDF file with default “zoom to page level” (pdfbox)

后端 未结 1 728
说谎
说谎 2021-01-17 03:19

I create a PDF file using pdfbox 2.0. when i open this pdf file in Adobe reader (windows), by default its open with zoom fit width.

What I n

相关标签:
1条回答
  • 2021-01-17 03:22

    Use PDPageFitDestination instead of PDPageXYZDestination - so your code looks like this now:

    PDPageFitDestination dest = new PDPageFitDestination();
    PDActionGoTo action = new PDActionGoTo();    
    action.setDestination(dest);    
    document.getDocumentCatalog().setOpenAction(action);
    
    0 讨论(0)
提交回复
热议问题