Class PDFConverter

java.lang.Object
org.ofdrw.converter.ofdconverter.PDFConverter
All Implemented Interfaces:
Closeable, AutoCloseable, DocConverter

public class PDFConverter extends Object implements DocConverter
PDF转换为OFD转换器
Since:
2023-3-14 23:09:08
Author:
权观宇
  • Constructor Details

    • PDFConverter

      public PDFConverter(Path ofdPath) throws IOException
      创建PDF转换OFD转换器
      Parameters:
      ofdPath - 转换后的OFD文件路径
      Throws:
      IOException - 文件解析异常
  • Method Details

    • convert

      public void convert(Path filepath, int... indexes) throws GeneralConvertException
      PDF转换为OFD页面
      Specified by:
      convert in interface DocConverter
      Parameters:
      filepath - 待转换文件路径
      indexes - 【可选】【可变】待转换页码(从0起),该参数仅在转换源文件类型为类文档文件时有效,当该参数不传或为空时表示转换全部内容到OFD。
      Throws:
      GeneralConvertException - 转换异常
    • setUUPMM

      public void setUUPMM(double uuPmm)
      设置每毫米容纳多少个用户单元(PDF单位)
      Parameters:
      uuPmm - 每毫米用户单元数
    • setEnableCopyAttachFiles

      public void setEnableCopyAttachFiles(boolean enableCopyAttachFiles)
      启用或禁用PDF附件向OFD复制
      Parameters:
      enableCopyAttachFiles - true - 启用复制; false - 禁用复制;默认为true 复制
    • setEnableCopyBookmarks

      public void setEnableCopyBookmarks(boolean enableCopyBookmarks)
      启用或禁用PDF书签向OFD复制
      Parameters:
      enableCopyBookmarks - true - 启用复制; false - 禁用复制;默认为true 复制
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException