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

};

相关推荐
郝学胜-神的一滴16 小时前
Qt的QSlider控件详解:从API到样式美化
开发语言·c++·qt·程序人生
郝学胜-神的一滴16 小时前
Qt的QComboBox控件详解:从API到样式定制
开发语言·c++·qt·程序人生·个人开发
大师兄66681 天前
Qt-for-鸿蒙PC-Electron应用鸿蒙平台白屏问题修复实战
qt·electron·harmonyos
雲烟1 天前
Qt SQLite在I.mx8上使用问题
数据库·qt·i.mx8
Jay Chou why did1 天前
11. Qt深入 QPixmap QBitmap QImage QPicture
qt
蓝天智能1 天前
立体字型效果的Qt QSS实现
开发语言·qt
得鹿梦鱼、2 天前
QT案例 记录使用Halcon机器视觉的深度学习实现猫狗图像二分类
qt·halcon·猫狗图像二分类
q***23572 天前
RabbitMQ介绍以及基本使用
qt·rabbitmq·ruby
王宪笙2 天前
Qt之数据库使用示例
数据库·qt
Jonathan Star2 天前
JSON-RPC 2.0 详解
qt·rpc·json