libreoffice-micro/pb/libreoffice.proto
2026-04-30 19:25:59 +08:00

34 lines
1.2 KiB
Protocol Buffer
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto3";
// protoc命令: cd pb && protoc libreoffice.proto --go_out=. --go-triple_out=useOldVersion=true:. libreoffice.proto
package libreoffice;
option go_package = "./libreoffice;libreoffice";
// 将文件转换为 PDF通过 URL
message ConvertToPdfRequest {
string fileUrl = 1; // 源文件 URL支持 docx/xlsx/pptx 等)
string fileName = 2; // 文件名(含扩展名),用于判断格式
}
message ConvertToPdfResponse {
bytes pdfData = 1; // 转换后的 PDF 二进制数据
string fileName = 2; // PDF 文件名
}
// 将文件转换为 PDF通过文件二进制数据
message ConvertToPdfFromBytesRequest {
bytes fileData = 1; // 文件二进制数据
string fileName = 2; // 文件名(含扩展名),用于判断格式
}
message ConvertToPdfFromBytesResponse {
bytes pdfData = 1; // 转换后的 PDF 二进制数据
string fileName = 2; // PDF 文件名
}
service LibreofficeService {
// 文件转 PDFURL 方式)
rpc ConvertToPdf(ConvertToPdfRequest) returns (ConvertToPdfResponse);
// 文件转 PDF二进制数据方式
rpc ConvertToPdfFromBytes(ConvertToPdfFromBytesRequest) returns (ConvertToPdfFromBytesResponse);
}