当前位置:网站首页>PHP 图片转PDF
PHP 图片转PDF
2022-08-04 15:13:00 【小洪帽i】
下载html2pdf:
链接: https://pan.baidu.com/s/1DBMb01raWqgWwMZPn-KKAQ
提取码: 95yk
//引入PDF类
require("pdf.php");
//定义图片路径
$image = './1.jpg';
//实例化
$pdf = new \FPDF();
$pdf->AddPage();
//设置PDF的边缘位置
$pdf->Image($image,20,40,170,170);
//输出PDF页面
$pdf->Output();
//转换成文档并保存 第一个参数:你转换的文件名称,可以自己设置名称 第二参数为:F
$pdf->Output('./1.pdf',"F");
详情看官网:convert image into pdf using php – Ishakali
FPDF文件介绍和下载:FPDF
边栏推荐
- 【Harmony OS】【FAQ】Hongmeng Questions Collection 2
- Technology sharing | Description of the electronic fence function in the integrated dispatching system
- C# 判断文件编码
- 饿了么智能头盔专利获授权,进一步提升骑手安全保障
- Semaphore 基本原理
- 16、学习MySQL 正则表达式
- [Beiya data recovery] IBM System Storage storage lvm information lost data recovery solution
- Redis-哨兵模式
- Flutter 运动鞋商铺小demo
- 1403. Minimum Subsequence in Non-Increasing Order
猜你喜欢
leetcode:250. 统计同值子树
小程序|炎炎夏日、清爽一夏、头像大换装
【Today in History】August 4: First female Turing Award winner; NVIDIA acquires MediaQ; first Cybersecurity Challenge completed
2022杭电多校4
RTC 场景下的屏幕共享优化实践
leetcode: 250. Count subtrees of equal value
Byte、Short、Integer、Long内部缓存类的对比与源码分析
NUS颜水成等发布首篇《深度长尾学习》综述
如何优雅的消除系统重复代码?
16、学习MySQL 正则表达式
随机推荐
PTA 6-2 多项式求值
Cisco - Small Network Topology (DNS, DHCP, Web Server, Wireless Router)
Hangzhou Electric School Competition (Counter Attack Index)
输入输出流总结
什么,你告诉我?作用域也分种类?
微软表示将向内部网络安全专家共享数据 为企业提供更安全保护
Why, when you added a unique index or create duplicate data?
Oracle database user creation, restart, import and export
多线程编程之优先级翻转问题
C# 判断文件编码
Bluetooth Technology|In the first half of the year, 1.3 million charging piles were added nationwide, and Bluetooth charging piles will become the mainstream of the market
Redis 高可用
I love Tanabata hahaha
16、学习MySQL 正则表达式
leetcode: 253. How many meeting rooms are required at least
快速整明白Redis中的字典到底是个啥
Online Excel based on Next.js
1403. 非递增顺序的最小子序列
C# 将dll打包到程序中
Technology sharing | Mini program realizes audio and video calls