2017-02-09 83 views

答えて

0

は、私は次のコードを使用して問題を解決することができました
2

PDFiumには、さまざまなFPDF_RenderPage *メソッドに渡すことができるFPDF_ANNOTフラグがあります。 PDFiumViewerコードが同じフラグをどこかに提供する可能性があります。

doc = PDDocument.load(FilePath); 
PDPage page = (PDPage)doc.getDocumentCatalog().getAllPages().get(pageNum); 
int rotPD = page.findRotation(); 
PDRectangle pageBound = page.findCropBox(); 
PDRectangle rect = ModifyRectAccordingToRotation(rectangle, rotPD, pageBound); 
PDAnnotationLink txtLink = new PDAnnotationLink(); 
    PDBorderStyleDictionary borderULine = new PDBorderStyleDictionary(); 
        borderULine.setStyle(PDBorderStyleDictionary.STYLE_UNDERLINE); 
borderULine.setWidth(0); 
txtLink.setBorderStyle(borderULine); 
PDActionRemoteGoTo remoteGoto = new PDActionRemoteGoTo(); 
PDComplexFileSpecification fileDesc = new PDComplexFileSpecification(); 
fileDesc.setFile(System.IO.Path.GetFileName(path)); 
remoteGoto.setOpenInNewWindow(true); 
remoteGoto.setFile(fileDesc); 
txtLink.setAction(remoteGoto); 
txtLink.setRectangle(rect); 
page.getAnnotations().add(txtLink); 
関連する問題