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

};

相关推荐
JCBP_1 天前
QT(1)
开发语言·汇编·c++·qt
可峰科技1 天前
qt配置ros2环境,简单版本
开发语言·qt
谱写秋天1 天前
VSCode+Qt+CMake详细地讲解
c++·ide·vscode·qt·编辑器
ajassi20001 天前
开源 C++ QT Widget 开发(六)通讯--TCP调试
c++·qt·开源
Forward♞1 天前
Qt——网络通信(UDP/TCP/HTTP)
开发语言·c++·qt
老赵的博客2 天前
QT的项目pro qmake编译
开发语言·qt
WALL-EC2 天前
Qt工具栏中图标槽函数没有响应的问题分析
开发语言·qt·osgearth
春蕾夏荷_7282977253 天前
qt ElaWidgetTools第一个实例
开发语言·qt
韭菜钟3 天前
在Qt中用cmake实现类似pri文件的功能
开发语言·qt·系统架构
韭菜钟3 天前
Qt从qmake迁移到cmake的记录
开发语言·qt