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; // 转换类型

};

相关推荐
Felix_One3 天前
Qt 串口通信避坑指南:QSerialPort 的 5 个常见问题
qt
blasit6 天前
笔记:Qt C++建立子线程做一个socket TCP常连接通信
c++·qt·tcp/ip
范特西.i11 天前
QT聊天项目(8)
开发语言·qt
枫叶丹411 天前
【Qt开发】Qt界面优化(七)-> Qt样式表(QSS) 样式属性
c语言·开发语言·c++·qt
十五年专注C++开发11 天前
Qt deleteLater作用及源码分析
开发语言·c++·qt·qobject
kangzerun11 天前
SQLiteManager:一个优雅的Qt SQLite数据库操作类
数据库·qt·sqlite
金刚狼8811 天前
qt和qt creator的下载安装
开发语言·qt
追烽少年x11 天前
Qt中使用Zint库显示二维码
qt
谁刺我心11 天前
qt源码、qt在线安装器镜像下载
开发语言·qt
金刚狼8811 天前
在qt creator中创建helloworld程序并构建
开发语言·qt