Qt pdf文件转换操作

qt文件转换操作,包括word转为pdf;Excel转为pdf;PPT转为pdf;image转为pdf;pdf转为文本文件;pdf导出图片;接口如下所示:

#pragma once

#include <QObject>

#include "filetransformhandle_global.h"

enum FileTransformType

{

fttNone = 0,

fttWordToPdf = 1, //word转为pdf

fttExcelToPdf = 2, //Excel转为pdf

fttPPTToPdf = 3, //PPT转为pdf

fttImageToPdf = 4, //image转为pdf

fttpdfToText = 5, //提取pdf文本

fttpdfToImage = 6, //pdf导出图片 strDesFilePath:表示导出的文件夹

fttcmdpdfToText = 7, // 命令行提取pdf的文本

fttcmdpdfToHtml = 8, // 命令行提取pdf到html

fttDirImageToPdf = 9, // 多个image转为pdf strSourceFilePath:表示文件夹

};

class FILETRANSFORMHANDLE_EXPORT FileTrasformOperatorHandle : public QObject

{

Q_OBJECT

public:

FileTrasformOperatorHandle();

FileTrasformOperatorHandle(const QString& strSourceFilePath, const QString& strDesFilePath);

void setTransformType(FileTransformType eTransformType);

void setSourceFilePath(const QString& strSourceFilePath);

void setTargetFilePath(const QString& strDesFilePath);

void run();

bool runCommand(const QString& strParam);

private:

void _run(const QString& strParam);

signals:

void startTransform(const QString& pdfFilePath);

void finished(const QString& pdfFilePath);

private:

QString m_strSourceFilePath; // 源文件

QString m_strDesFilePath; // 目的文件

FileTransformType m_eTransformType; // 转换类型

};

相关推荐
NiNi_suanfa19 小时前
【Qt】Qt 批量修改同类对象
开发语言·c++·qt
mengzhi啊20 小时前
c++11的变参模板和c++17的左折叠
qt
路痴楷1 天前
无法定位程序输入点问题
c++·qt·visual studio
Source.Liu1 天前
【LibreCAD】 RS_Units 类完整解析
c++·qt·rust
偶像你挑的噻1 天前
2.Qt-基础核心以及信号与槽
开发语言·qt
爱吃巧克力的程序媛1 天前
Qt 异步编程---概述
开发语言·qt
天涯路s1 天前
qt怎么自定义日志
开发语言·qt
四维碎片1 天前
【Qt】QTimer 学习笔记总结
笔记·qt·学习
qq_401700411 天前
理解与优化Qt信号槽机制提高性能优化
qt
蚂蚁取经1 天前
Qt C++ 小部件 QCustomPlot 的使用
c++·qt·信息可视化