欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Java?pdf文件書(shū)簽承前縮放驗(yàn)證的設(shè)置方法

 更新時(shí)間:2022年02月24日 12:01:13   作者:Aimyone  
很多朋友不知道是什么是書(shū)簽承前縮放,簡(jiǎn)單說(shuō)就是可以任意改變當(dāng)前pdf文檔縮放比例,點(diǎn)擊書(shū)簽后不影響其縮放比率,本文給大家介紹下Java?pdf文件書(shū)簽承前縮放驗(yàn)證的設(shè)置方法,感興趣的朋友一起看看吧

1,什么是書(shū)簽承前縮放?

在這里插入圖片描述
換句話來(lái)說(shuō)

設(shè)置了承前縮放,當(dāng)你手動(dòng)將page4縮放到145%,然后點(diǎn)擊書(shū)簽1,書(shū)簽1定位到的page1的縮放比例也是145%

2,如何設(shè)置書(shū)簽承前縮放?

使用工具:

在這里插入圖片描述

承前縮放書(shū)簽設(shè)置:

在這里插入圖片描述

其他類型書(shū)簽設(shè)置:

在這里插入圖片描述

3,代碼

3.1 書(shū)簽結(jié)構(gòu):

在這里插入圖片描述

3.2 代碼

import com.aspose.pdf.*;
public class bookmark {
    public static void main(String[] args) {
        // Open document
        Document pdfDocument = new Document("D:\\chromeDownload\\測(cè)試版2.pdf");
        OutlineCollection outlines = pdfDocument.getOutlines();
        for (OutlineItemCollection outlineItem : (Iterable<OutlineItemCollection>) outlines) {
            double soureceZoom = -1;
            if (outlineItem.getDestination() != null) {
                soureceZoom = getAppointmentZoom(outlineItem.getDestination());
            } else if (outlineItem.getAction() != null) {
                soureceZoom = getAppointmentZoom(outlineItem.getAction());
            }
            if(soureceZoom == -1){
                System.out.println("書(shū)簽必須承前縮放,書(shū)簽名:" + outlineItem.getTitle() + ",縮放因子: " + soureceZoom);
//            System.out.println("Title : " + outlineItem.getTitle() + ",縮放因子: " + soureceZoom);
            if (outlineItem.size()>0){
                checkBookmark(outlineItem);
        }
    }
    private static void checkBookmark(OutlineItemCollection Outlines) {
    private static double getAppointmentZoom(IAppointment appointment) {
        if (appointment instanceof XYZExplicitDestination) {
            XYZExplicitDestination destination = (XYZExplicitDestination) appointment;
            return destination.getZoom();
        } else if (appointment instanceof GoToAction) {
            GoToAction goToAction = (GoToAction) appointment;
            if (goToAction.getDestination() instanceof XYZExplicitDestination) {
                XYZExplicitDestination destination = (XYZExplicitDestination) goToAction.getDestination();
                return destination.getZoom();
        } else if (appointment instanceof GoToRemoteAction) {
            GoToRemoteAction goToRemoteAction = (GoToRemoteAction) appointment;
            if (goToRemoteAction.getDestination() instanceof XYZExplicitDestination) {
                XYZExplicitDestination destination = (XYZExplicitDestination) goToRemoteAction.getDestination();
        return -1;
}

3.3 控制臺(tái)輸出:

在這里插入圖片描述

注意:承前縮放的因子為 0;

4,書(shū)簽的xml文件導(dǎo)出

4.1 代碼

import com.aspose.pdf.Document;
import com.aspose.pdf.facades.PdfBookmarkEditor;
import java.io.FileNotFoundException;
public class AsposeTest {
    public static void main(String[] args) throws FileNotFoundException {
        Document document6 = new Document("D:\\測(cè)試版2.pdf");
        exportBookmarksToXML(document6);
    }
    public static void exportBookmarksToXML(Document document) throws FileNotFoundException {
        PdfBookmarkEditor pdfBookmarkEditor = new PdfBookmarkEditor();
        pdfBookmarkEditor.bindPdf(document);
        pdfBookmarkEditor.exportBookmarksToXML("D:\\測(cè)試版2.xml");
        pdfBookmarkEditor.getDocument().save();
}

4.2 導(dǎo)出文件:

<?xml version="1.0" encoding="iso_8859_1"?>
<Bookmark>
  <Title Open="True">&#30446;&#24405;縮放到頁(yè)面級(jí)別
	  <Title Page="2 XYZ 71 769 0" Action="GoTo" Open="True">3.2.S.7 &#31283;&#23450;&#24615;承前縮放
		  <Title>3.2.S.7.1 &#31283;&#23450;&#24615;&#24635;&#32467;</Title>實(shí)際大小
		  <Title Page="5 FitBH 842" Action="GoTo">3.2.S.7.2 &#19978;&#24066;&#21518;&#31283;&#23450;&#24615;&#26041;&#26696;&#21644;&#31283;&#23450;&#24615;&#25215;&#35834;</Title>適合可見(jiàn)
		  <Title Page="8 XYZ 71 523 0" Action="GoTo">3.2.S.7.3 &#31283;&#23450;&#24615;&#25968;&#25454;</Title>承前縮放
	  </Title>
  </Title>
  
  <Title Page="1 XYZ 0 842 0" Action="GoTo" Open="False">&#34920;&#30446;&#24405;</Title>承前縮放
  <Title Page="1 XYZ 0 842 0" Action="GoTo" Open="False">&#22270;&#30446;&#24405;</Title>承前縮放
</Bookmark>

aspose.pdf 官網(wǎng)指路 : https://docs.aspose.com/pdf/java/get-update-and-expand-bookmark/

到此這篇關(guān)于Java pdf文件書(shū)簽承前縮放驗(yàn)證的文章就介紹到這了,更多相關(guān)Java 書(shū)簽承前縮放驗(yàn)證內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Zookeeper連接超時(shí)問(wèn)題與拒絕連接的解決方案

    Zookeeper連接超時(shí)問(wèn)題與拒絕連接的解決方案

    今天小編就為大家分享一篇關(guān)于Zookeeper連接超時(shí)問(wèn)題與拒絕連接的解決方案,小編覺(jué)得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來(lái)看看吧
    2019-03-03
  • java實(shí)現(xiàn)一致性hash算法實(shí)例代碼

    java實(shí)現(xiàn)一致性hash算法實(shí)例代碼

    這篇文章主要給大家介紹了關(guān)于java實(shí)現(xiàn)一致性hash算法的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-12-12
  • 使用Java實(shí)現(xiàn)接口攔截器來(lái)監(jiān)控接口的執(zhí)行情況

    使用Java實(shí)現(xiàn)接口攔截器來(lái)監(jiān)控接口的執(zhí)行情況

    在排查問(wèn)題的時(shí)候,由于沒(méi)有對(duì)接口的執(zhí)行情況,以及入?yún)⑦M(jìn)行監(jiān)控,所以排查起問(wèn)題就特別費(fèi)勁,今天我們就一起來(lái)寫(xiě)一個(gè)接口的攔截器來(lái)監(jiān)控接口的執(zhí)行情況吧
    2024-01-01
  • Mybatis-Plus實(shí)體類注解方法與mapper層和service層的CRUD方法

    Mybatis-Plus實(shí)體類注解方法與mapper層和service層的CRUD方法

    CRUD是指在做計(jì)算處理時(shí)的增加(Create)、讀取查詢(Retrieve)、更新(Update)和刪除(Delete)幾個(gè)單詞的首字母簡(jiǎn)寫(xiě)。主要被用在描述軟件系統(tǒng)中DataBase或者持久層的基本操作功能,下面讓我們一起看看吧
    2022-03-03
  • java實(shí)現(xiàn)批量生成二維碼

    java實(shí)現(xiàn)批量生成二維碼

    這篇文章主要為大家詳細(xì)介紹了java實(shí)現(xiàn)批量生成二維碼的相關(guān)代碼,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2019-05-05
  • springboot集成mybatisplus實(shí)例詳解

    springboot集成mybatisplus實(shí)例詳解

    這篇文章主要介紹了springboot集成mybatisplus實(shí)例詳解,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2019-09-09
  • Java Hibernate對(duì)象(瞬時(shí)態(tài),持久態(tài),脫管態(tài))詳解

    Java Hibernate對(duì)象(瞬時(shí)態(tài),持久態(tài),脫管態(tài))詳解

    這篇文章主要介紹了Java Hibernate對(duì)象(瞬時(shí)態(tài),持久態(tài),脫管態(tài))詳解的相關(guān)資料,這里對(duì)Java Hibernate對(duì)象進(jìn)行了介紹及總結(jié),需要的朋友可以參考下
    2016-11-11
  • Java 如何從spring容器中獲取注入的bean對(duì)象

    Java 如何從spring容器中獲取注入的bean對(duì)象

    這篇文章主要介紹了Java 如何從spring容器中獲取注入的bean對(duì)象,幫助大家更好的理解和使用Java,感興趣的朋友可以了解下
    2020-11-11
  • springboot之如何獲取項(xiàng)目目錄路徑

    springboot之如何獲取項(xiàng)目目錄路徑

    這篇文章主要介紹了springboot之如何獲取項(xiàng)目目錄路徑問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-05-05
  • Arthas-java程序運(yùn)行時(shí)debug工具使用

    Arthas-java程序運(yùn)行時(shí)debug工具使用

    這篇文章主要介紹了Arthas-java程序運(yùn)行時(shí)debug工具使用,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-11-11

最新評(píng)論