此方法安装了llPDFLib.v3.6 控件、对pdf左侧、右侧正文进行了操作。

procedure TForm1.Button1Click(Sender: TObject);
var node,nd1:TPDFOutlineNode;
PW,ph:integer;
bmp:TBitmap;
begin
bmp:=TBitmap.Create;
bmp.LoadFromFile('d:\4601.bmp');
sPdf:=TPDFDocument.Create(nil);
//pdf文档信息
sPdf.DocumentInfo.CreationDate:=Now;
sPdf.DocumentInfo.Producer:='Producer';
sPdf.DocumentInfo.Author:='Author';
sPdf.DocumentInfo.Creator:='Creator';
sPdf.DocumentInfo.Keywords:='Keywords';
sPdf.DocumentInfo.Subject:='subject';
sPdf.DocumentInfo.Title:='Title'; sPdf.FileName:='d:\tt.pdf';
sPdf.Compression:=ctFlate;
spdf.OwnerPassword:='123';
sPdf.ProtectionEnabled:=True;
sPdf.PageMode:= pmUseOutlines;
sPdf.AutoLaunch:=true;
sPdf.PageLayout:=plSinglePage; sPdf.BeginDoc;
node:=sPdf.Outlines.Add(nil,'目录1',TPDFGoToPageAction.Create,GB2312_CHARSET);
node.Expanded:=True;
TPDFGoToPageAction(node.Action).PageIndex:=0;
nd1:=sPdf.Outlines.AddChild(node,'第一章',TPDFGoToPageAction.Create,GB2312_CHARSET);
nd1.Expanded:=true;
TPDFGoToPageAction(nd1.Action).PageIndex:=0;
pw:=sPdf.PageWidth;
ph:=sPdf.PageHeight;
sPdf.CurrentPage.SetActiveFont('黑体',[fsUnderline],50,GB2312_CHARSET);
with sPdf do
begin
Canvas.Font.Size:=50;
Canvas.Font.Color:=clRed;
Canvas.Font.Style:=[fsBold,fsUnderline];
Canvas.MoveTo(0,10);
Canvas.LineTo(PW,10);
SetTextAlign(sPdf.Canvas.Handle, TA_CENTER or TA_TOP); //居中
Canvas.TextOut(Round(pw/2),30,'新的故事就要开始了');
Canvas.TextOut(50,30,IntToStr(pw)+','+inttostr(ph));
Canvas.MoveTo(0,50);
Canvas.LineTo(PW,50);
Canvas.Draw(100,100,bmp);
end;
sPdf.NewPage;
nd1:=sPdf.Outlines.AddChild(node,'第二章',TPDFGoToPageAction.Create,GB2312_CHARSET);
nd1.Expanded:=true;
TPDFGoToPageAction(nd1.Action).PageIndex:=1;
sPdf.EndDoc;
sPdf.Free;
bmp.Free;
end;

  

最新文章

  1. JavaEE学习文章汇总-并发,集群,分布式
  2. JavaScript学习(一)—处理事件
  3. javascript 分页组件
  4. cg tut
  5. NYOJ 21 三个水杯
  6. [chrome插件] 利滚利计算器 银行存款 基金理财 余额宝收益计算
  7. 如何让MFC程序关闭按钮失效,也无法右击任务栏关闭窗口来关闭?
  8. Android Clipboard(复制/剪贴板)
  9. MVC4中使用SignalR
  10. WPF使用资源字典组织资源
  11. PHP 运行 php-fpm 报错
  12. [Codeforces 176B]Word Cut
  13. Python_FTP通讯软件
  14. hostnamectl 修改 CentOS7 主机名
  15. 使用AdminLTE 在content区,打开相应网页
  16. GBDT理论知识总结
  17. Nginx学习基础(一)
  18. 修改 GitHub 仓库默认显示的项目语言类型
  19. 微信小程序中使用wxParse展示HTML内容
  20. 【IdentityServer4文档】- 支持和咨询选项

热门文章

  1. 使用LoadRunner监控Apache的步骤 (转)
  2. IDC机房与阿里云vpc网络建立高速通道
  3. 云解析DNS使用教程
  4. 基于tornado实现web camera
  5. PHP 命名空间namespace 和 use
  6. unity, 烘焙lightmap
  7. 判断当前VC 是push还是present的
  8. web info
  9. windows system.exe占用文件
  10. codeblocks如何watch指针