使用DebenuPDFLibrary导出微信中的照片

本文详细介绍了如何下载并使用Debenu PDF Library源码版进行PDF文件的操作,包括无需安装直接运行样例,设置库路径,从微信公众号微官网打印PDF文件,以及利用PDF Library将PDF中的图片导出为JPG格式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、下载DebenuPDFLibrary1114源码版,

2、无需安装,直接打开sample样例,再options中添加libraries path,“D:\riocomponents\Debenu Quick.PDF Library 11.14 XE10.3 Full Source\DebenuPDFLib”路径。

3、打开微信公众号微官网,打印到pdf文件。参见博客https://blog.youkuaiyun.com/winniezhang/article/details/85540689

4、利用PDFLibrary的pdf导出image功能,导出pdf中的照片,代码如下。

uses
  DebenuPDFLibrary1114;

  public
    { Public declarations }
    QP: TQuickPDF;
    UnlockResult: Integer;


procedure TForm2.btnConvertClick(Sender: TObject);
var
SaveResult: Integer;
sFileName, newName ,LICENSE : AnsiString;
iNumpages : integer;
begin
if ListBox1.Items.Count < 1 then
begin
  ShowMessage('There are no images to convert. Please add one or more images to the list and try again.');
end;
  QP := TQuickPDF.Create;
try
  LICENSE := QP.LicenseInfo;
  UnlockResult := QP.UnlockKey(LICENSE);
  if UnlockResult = 0 then //判断是否有key,此例中使用的是源码版的PDFlibrary
  begin
    ShowMessage('Quick PDF Library could not be unlocked, please check your license key and try again.');
  end else
  begin
    for sFileName in ListBox1.Items do
    begin
        QP.LoadFromFile(sFileName , LICENSE);
        inumpages := QP.PageCount;
        SaveResult := QP.RenderDocumentToFile(72, 1,iNumPages,0,txtOutputLocation.Text + '\' + newName + '.jpg' );
    end;
  end;
finally
  QP.Free;
end;

3、结果。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值