批量修改 Word 、Excel、PPT 文档中的标题、作者、版本号、公司、创建时间等元数据

概要:「我的ABC软件工具箱」提供了强大的修改 Office 文档元数据的功能,包括常见的作者、版本号、公司、创建时间、修改时间等这些信息。支持的文档格式有 Word 、Excel、PPT,既能够对原数据进行修改,也能对元数据进行删除!操作起来非常简单,处理特别高效。

文档的元数据可能很多人并没有留意过,但是这些信息却是非常非常重要的!每一个 Office 都包含元数据,这些信息用来描述文档的基本的信息。Office 文档的元数据主要包含:标题、版本、公司、文档创建者、最后修改者、文档创建时间、最后一次保存时间、最后一次打印时间等等。我们在 Office 文档上「右键」-「属性」,就能看到这些信息。

在上图的界面中,我们可以对每一个元数据进行修改,并且我们每次对文件修改保存都会使元数据发生变化。当我们有大批量的文件需要修改元数据的时候,我们怎么办呢?今天给大家介绍下使用办公软件「我的ABC软件工具箱」来对元数据进行修改!

打开「我的ABC软件工具箱」,左侧面板选择【文件属性】,右侧就能看到【批量修改 Office 元数据】的按钮!

点击菜单按钮,会进入到选择文件的页面。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,以下是一个Java获取各种文档页数的工具类,使用了Apache POI和Apache PDFBox库: ``` import java.io.File; import java.io.FileInputStream; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.hslf.usermodel.HSLFSlideShow; import org.apache.poi.sl.usermodel.SlideShow; import org.apache.poi.hwpf.HWPFDocument; import org.apache.poi.hwpf.usermodel.Range; import org.apache.poi.xslf.usermodel.XMLSlideShow; import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.pdfbox.pdmodel.PDDocument; public class DocumentPageCount { public static int getExcelPageCount(String filePath) { try { File file = new File(filePath); FileInputStream fis = new FileInputStream(file); Workbook workbook = null; if (filePath.endsWith(".xls")) { workbook = new HSSFWorkbook(fis); } else if (filePath.endsWith(".xlsx")) { workbook = new XSSFWorkbook(fis); } fis.close(); return workbook.getNumberOfSheets(); } catch (Exception e) { e.printStackTrace(); return 0; } } public static int getPptPageCount(String filePath) { try { File file = new File(filePath); FileInputStream fis = new FileInputStream(file); SlideShow slideshow = null; if (filePath.endsWith(".ppt")) { slideshow = new HSLFSlideShow(fis); } else if (filePath.endsWith(".pptx")) { slideshow = new XMLSlideShow(fis); } fis.close(); return slideshow.getSlides().size(); } catch (Exception e) { e.printStackTrace(); return 0; } } public static int getWordPageCount(String filePath) { try { File file = new File(filePath); FileInputStream fis = new FileInputStream(file); HWPFDocument doc = null; Range range = null; XWPFDocument docx = null; if (filePath.endsWith(".doc")) { doc = new HWPFDocument(fis); range = doc.getRange(); } else if (filePath.endsWith(".docx")) { docx = new XWPFDocument(fis); range = docx.getDocument().getBody().getDocumentContent().getEndOfContent().getRange(); } fis.close(); return range.numParagraphs(); } catch (Exception e) { e.printStackTrace(); return 0; } } public static int getPdfPageCount(String filePath) { try { File file = new File(filePath); PDDocument document = PDDocument.load(file); int pageCount = document.getNumberOfPages(); document.close(); return pageCount; } catch (Exception e) { e.printStackTrace(); return 0; } } } ``` 这个工具类包含了四个方法,分别用于获取ExcelPPTWord和PDF文档的页数。您可以在自己的项目使用这些方法来获取文档的页数。例如,要获取一个Excel文件的页数,可以调用`DocumentPageCount.getExcelPageCount("path/to/excel/file.xls")`。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值