2014-01-23 55 views
0

人誰可以幫助請,這是我的問題: 這是我用得到的PDF PagePanel代碼:PDFRenderer全-0.9.1我如何可以重置PgePanel放大後的PDF

File file = new File("C:\\mmmmm\\nnnnn\\nnn\\tutorial.pdf"); 
     RandomAccessFile raf = new RandomAccessFile(file, "r"); 
     FileChannel channel = raf.getChannel(); 
     ByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size()); 
     PDFFile pdffile = new PDFFile(buf); 

     // show the first page 
     PDFPage page = pdffile.getPage(0); 

     panel.useZoomTool(true); 
     panel.showPage(page); 

現在我的問題來了,當我放大使用鼠標,這是工作良好,因爲我希望,但是當我嘗試選擇第二頁,並顯示它在同一PagePanel它顯示在以前的縮放,我看不到一切該頁面,我想顯示在同一個面板上的第二頁,而不被放大。就像我放大之前的第一頁。任何幫助謝謝你。

回答

0

傢伙我來弄清楚如何縮小,從組合框事件 當我選擇了新的一頁我這樣做:

File file = new File("C:\\mmmmm\\nnnnn\\nnn\\tutorial.pdf"); 
     RandomAccessFile raf = new RandomAccessFile(file, "r"); 
     FileChannel channel = raf.getChannel(); 
     ByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size()); 
     PDFFile pdffile = new PDFFile(buf); 

     // show the first page 
     PDFPage page = pdffile.getPage(0); 
     panel.setClip(null); 
     panel.useZoomTool(false); 
     panel.showPage(page); 

,並在那裏我能得到新的頁面,而ZoomIn但隨後通過這樣做,它禁用useZoomTool,所以我做的是我添加了檢查useZoomTool再次爲true的方式。

對不起,我的英文我知道太破碎了,但我就是這樣工作的

相關問題