此方法安装了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;

  

Delphi Pdf的使用方法的更多相关文章

  1. Delphi之静态方法,虚方法virtual,动态dynamic,抽象abstract,消息

    Delphi之静态方法,虚方法virtual,动态dynamic,抽象abstract,消息 http://www.cnblogs.com/zhwx/archive/2012/08/28/266055 ...

  2. [delphi]indy idhttp post方法

    网易 博客 LOFTCam-用心创造滤镜 LOFTER-最美图片社交APP 送20张免费照片冲印 > 注册登录  加关注 techiepc的博客 万事如意 首页 日志 LOFTER 相册 音乐 ...

  3. Delphi的移动文件方法(转)/删除文件:/文件的复制

    RenameFile,DeleteFile,MoveFile Delphi的移动文件方法 uses  ShellApi; procedure ShellFileOperation(fromFile: ...

  4. delphi操作文本文件的方法简介

    delphi操作文本文件的方法简介减小字体 增大字体 作者佚名来源不详发布时间2008-5-31 10:31:16发布人xuedelphi1 文件类型和标准过程       Delphi同Object ...

  5. PHP制作pdf文档方法

    原文:PHP制作pdf文档方法 本篇博客是在看完 php+mysql web书以后自己的测试代码,虽然是测试代码,但不是简单的粘贴复制,为了学习thinkPHP框架,自己就用这个来做的,而且这本书已经 ...

  6. 怎么编辑PDF文件内容,PDF文件编辑方法

    怎样编辑PDF文件内容?这是一个常常困扰我们的问题,工作当中我们经常会收到PDF格式的文件,但有时的文件内容不是我们想要的或者是觉得不合理的需要改掉.但是每次有这样的问题时都没有什么好的解决方法,每次 ...

  7. PDF文件怎么修改,PDF文件编辑方法

    PDF文件是一种独特的文件,在日常办公中已经成为我们使用最广泛的电子文档格式.在使用PDF文件中会遇到PDF文件有错区的时候,再从新制作一个PDF文件会比较麻烦,只能通过工具来对PDF文件进行修改,这 ...

  8. [.NET开发] C#使用doggleReport生成pdf报表的方法

    本文实例讲述了C#使用doggleReport生成pdf报表的方法.分享给大家供大家参考,具体如下: 1. 安装nuget -install package DoddleReport -install ...

  9. PDG转图像、PDF的若干方法

    作者:马健邮箱:stronghorse_mj@hotmail.com发布:2006.05.26更新:2008.08.24 补充说明:此文成文较早,其中对Pdg2Pic.FreePic2Pdf的描述早已 ...

随机推荐

  1. jumpserverv0.5.0 基于 CentOS7安装部署

    基于 CentOS 7 一步一步安装 Jumpserver 0.5.0 环境 系统: CentOS 7 IP: 192.168.244.144 关闭 selinux和防火墙 # CentOS 7 $ ...

  2. Python课程之字典

    字典(dict) 一.定义:字典类型在其他语言中又称为map,是一种映射类型,并且{key:value}无序,其关键字必须为不可变类型(如:元组/字符串),在同一个字典中关键字必须互不相同(若出现相同 ...

  3. php对象序列化和cookie的问题,反序列化false

    php对象序列化和cookie的问题,反序列化false $searchKeywords = array("羊奶","肥皂"); $searchKeywords ...

  4. leetCode 87.Scramble String (拼凑字符串) 解题思路和方法

    Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrin ...

  5. 521. Longest Uncommon Subsequence I【easy】

    521. Longest Uncommon Subsequence I[easy] Given a group of two strings, you need to find the longest ...

  6. Mockito - Wanted but not invoked: Actually, there were zero interactions with this mock

    要测试的类:IndexController.java 代码: @Mock private TemplateWrapper templateWrapper = spy(new TemplateWrapp ...

  7. PhpMyAdmin 配置文件现在需要一个短语密码的解决方法

    新版本的PhpMyAdmin 增强了安全性,需要在配置文件设置一个短语密码.否则进入之后会有“配置文件现在需要一个短语密码.”的红色警叹提示. 解决方法: 1.将 phpMyAdmin/librari ...

  8. figure margins too large错误解决

    使用Rstudio,遇到下面这个错误: figure margins too large 这是因为界面右下角的“plot”窗口太小,显示不了,将右下角的窗口调大就能解决

  9. 第一百六十六节,jQuery,基础 DOM 和 CSS 操作,元素内容,元素属性,css和class,元素宽度高度、偏移、滚动条

    jQuery,基础 DOM 和 CSS 操作,元素内容,元素属性,css和class,元素宽度高度.偏移.滚动条 学习要点: 1.DOM 简介 2.设置元素及内容 3.元素属性操作 4.元素样式操作 ...

  10. web.xml文件:

    在web.xml配置文件是一个的J2EE配置文件,决定如何处理HTTP请求servlet容器的元素.它不是严格意义上的Struts2的配置文件,但它是一个文件,需要配置Struts2的工作. 正如前面 ...