base64 转 pdf

工作中经常会遇到一些签名的pdf传输,一般都是base64编码,这样就需要我们手动转为pdf,

其实根本不需要自己使用pdf的库写入,只是数据的简单写入就行

Go 复制代码
package main

import (
	"encoding/base64"
	"fmt"
	"os"
)

func main() {

	data := ""
	decoded, err := base64.StdEncoding.DecodeString(data)
	if err != nil {
		fmt.Println(err)
	}

	file, err := os.Create("receipt.pdf")
	defer file.Close() // 确保在函数退出时关闭文件
	file.Write(decoded)
}
相关推荐
南风微微吹1 天前
2015-2025年英语四级历年真题及答案解析电子版PDF(含听力音频)
pdf·英语四级
Metaphor6921 天前
使用 Python 将 Excel 转换为 PDF
python·pdf·excel
daanpdf1 天前
考研英语一历年真题及答案解析PDF(2010-2026)百度网盘
考研·pdf
daanpdf1 天前
历年考研数学一、数学二、数学三真题试卷及答案PDF
考研·pdf
南风微微吹1 天前
2026年初级社会工作者考试历年真题及答案解析PDF电子版(2010-2025年)
pdf
俊哥工具2 天前
不用安装不收费!多功能U盘修复工具,解决大部分U盘故障
学习·pdf·word·excel·音视频
daanpdf2 天前
曹德旺《心若菩提》PDF及读后感
pdf
asdzx672 天前
使用 Python 为 PDF 添加页码 (详细教程)
python·pdf·页码
小婷资料库2 天前
2025年新高考二卷数学真题试卷及答案解析电子版PDF
pdf·高考