亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? pdftypes.pas

?? 作者:Takeshi Kanno. PowerPdf是一款制作PDF文檔的VCL控件。使用上和QuickReport類似。
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
{*
 * << P o w e r P d f >> -- PdfTypes.pas
 *
 * Copyright (c) 1999-2001 Takezou. <takeshi_kanno@est.hi-ho.ne.jp>
 *
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Library General Public License as published
 * by the Free Software Foundation; either version 2 of the License, or any
 * later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Library general Public License for more
 * details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library.
 *
 * Create 2001.03.10
 *
 *}
unit PdfTypes;

interface

// if use "FlateDecode" compression, comment out the next line.
// (this unit and PdfDoc.pas)
{$DEFINE NOZLIB}

uses
  SysUtils, Classes, Windows
{$IFNDEF NOZLIB}
  ,Zlib;
{$ELSE}
  ;
{$ENDIF}

const
{$IFNDEF NOZLIB}
  USE_ZLIB = true;
{$ELSE}
  USE_ZLIB = false;
{$ENDIF}

  POWER_PDF_VERSION_TEXT = 'PowerPdf version 0.8兝';

  {*
   * PreDefined page size
   *}
  PDF_PAGE_WIDTH_A4 = 596;
  PDF_PAGE_HEIGHT_A4 = 842;

  {*
   * Dafault page size.
   *}
  PDF_DEFAULT_PAGE_WIDTH = PDF_PAGE_WIDTH_A4;
  PDF_DEFAULT_PAGE_HEIGHT = PDF_PAGE_HEIGHT_A4;

  {*
   * Const for xref entry.
   *}
  PDF_IN_USE_ENTRY = 'n';
  PDF_FREE_ENTRY = 'f';
  PDF_MAX_GENERATION_NUM = 65535;

  {*
   * 6A61 means ASCII code "ja".
   * UNICode string in Info object is consists of "FEFF" + "001B" +
   * <language identifiers> + "001B".
   *}
  PDF_LANG_STRING_JP = '6A61';
  PDF_UNICODE_HEADER = 'FEFF001B' + PDF_LANG_STRING_JP + '001B';

  {*
   * collection of flags defining various characteristics of the font.
   *}
  PDF_FONT_FIXED_WIDTH = 1;
  PDF_FONT_SERIF       = 2;
  PDF_FONT_SYMBOLIC    = 4;
  PDF_FONT_SCRIPT      = 8;
  // Reserved          = 16
  PDF_FONT_STD_CHARSET = 32;
  PDF_FONT_ITALIC      = 64;
  // Reserved          = 128
  // Reserved          = 256
  // Reserved          = 512
  // Reserved          = 1024
  // Reserved          = 2048
  // Reserved          = 4096
  // Reserved          = 8192
  // Reserved          = 16384
  // Reserved          = 32768
  PDF_FONT_ALL_CAP     = 65536;
  PDF_FONT_SMALL_CAP   = 131072;
  PDF_FONT_FOURCE_BOLD = 262144;

  PDF_DEFAULT_FONT = 'Arial';
  PDF_DEFAULT_FONT_SIZE = 10;

  PDF_MAX_HORIZONTALSCALING = 300;

  PDF_ENTRY_CLOSED = 0;
  PDF_ENTRY_OPENED = 1;

  CRLF = #13#10;
  LF = #10;

type
  TPdfObjectType = (otDirectObject,
                    otIndirectObject,
                    otVirtualObject);

  {*
   * object manager is virtual class to manage instance of indirectobject
   *}
  TPdfObject = class;
  TPdfObjectMgr = class(TPersistent)
  public
    procedure AddObject(AObject: TPdfObject); virtual; abstract;
    function GetObject(ObjectID: integer): TPdfObject; virtual; abstract;
  end;

  {*
   * objects declaration.
   *}
  TPdfObject = class(TPersistent)
  private
    FObjectType: TPdfObjectType;
    FObjectNumber: integer;
    FGenerationNumber: integer;
  protected
    procedure InternalWriteStream(const AStream: TStream); virtual;
  public
    procedure SetObjectNumber(Value: integer);
    constructor Create; virtual;
    procedure WriteToStream(const AStream: TStream);
    procedure WriteValueToStream(const AStream: TStream);
    property ObjectNumber: integer read FObjectNumber;
    property GenerationNumber: integer read FGenerationNumber;
    property ObjectType: TPdfObjectType read FObjectType;
  end;

  TPdfVirtualObject = class(TPdfObject)
  public
    constructor Create; override;
    constructor CreateVirtual(AObjectId: integer);
  end;

  TPdfNumber = class(TPdfObject)
  private
    FValue: integer;
  protected
    procedure InternalWriteStream(const AStream: TStream); override;
  public
    constructor CreateNumber(AValue: Integer);
    property Value: integer read FValue write FValue;
  end;

  TPdfReal = class(TPdfObject)
  private
    FValue: double;
  protected
    procedure InternalWriteStream(const AStream: TStream); override;
  public
    constructor CreateReal(AValue: double);
    property Value: double read FValue write FValue;
  end;

  TPdfString = class(TPdfObject)
  private
    FValue: string;
   protected
    procedure InternalWriteStream(const AStream: TStream); override;
  public
    constructor CreateString(AValue: string);
    property Value: string read FValue write FValue;
  end;

  TPdfText = class(TPdfObject)
  private
    FValue: string;
  protected
    procedure InternalWriteStream(const AStream: TStream); override;
  public
    constructor CreateText(AValue: string);
    property Value: String read FValue write FValue;
  end;

  TPdfName = class(TPdfObject)
  private
    FValue: string;
    function EscapeName(const Value: string): string;
  protected
    procedure InternalWriteStream(const AStream: TStream); override;
  public
    constructor CreateName(AValue: string);
    property Value: String read FValue write FValue;
  end;

  TPdfArray = class(TPdfObject)
  private
    FArray: TList;
    FObjectMgr: TPdfObjectMgr;
    function GetItems(Index: integer): TPdfObject;
    function GetItemCount: integer;
  protected
    procedure InternalWriteStream(const AStream: TStream); override;
  public
    constructor CreateArray(AObjectMgr: TPdfObjectMgr);
    constructor CreateNumArray(AObjectMgr: TPdfObjectMgr; AArray: array of Integer);
    destructor Destroy; override;
    procedure AddItem(AItem: TPdfObject);
    function FindName(AName: string): TPdfName;
    function RemoveName(AName: string): boolean;
    property Items[Index: integer]: TPdfObject read GetItems;
    property ItemCount: integer read GetItemCount;
    property ObjectMgr: TPdfObjectMgr read FObjectMgr;
  end;

  TPdfDictionaryElement = class(TObject)
  private
    FKey: TPdfName;
    FValue: TPdfObject;
    FIsInternal: boolean;
    function GetKey: string;
  public
    constructor Create(AKey: string; AValue: TPdfObject);
    constructor CreateAsInternal(AKey: string; AValue: TPdfObject; AVoid: Pointer);
    destructor Destroy; override;
    property Key: string read GetKey;
    property Value: TPdfObject read FValue;
    property IsInternal: boolean read FIsInternal;
  end;

  TPdfDictionary = class(TPdfObject)
  private
    FArray: TList;
    FObjectMgr: TPdfObjectMgr;
    function GetItems(Index: integer): TPdfDictionaryElement;
    function GetItemCount: integer;
  protected
    procedure InternalWriteStream(const AStream: TStream); override;
  public
    constructor CreateDictionary(AObjectMgr: TPdfObjectMgr);
    destructor Destroy; override;
    function ValueByName(AKey: string): TPdfObject;
    function PdfNumberByName(AKey: string): TPdfNumber;
    function PdfTextByName(AKey: string): TPdfText;
    function PdfRealByName(AKey: string): TPdfReal;
    function PdfStringByName(AKey: string): TPdfString;
    function PdfNameByName(AKey: string): TPdfName;
    function PdfDictionaryByName(AKey: string): TPdfDictionary;
    function PdfArrayByName(AKey: string): TPdfArray;
    procedure AddItem(AKey: string; AValue: TPdfObject);
    procedure AddNumberItem(AKey: string; AValue: Integer);
    procedure AddNameItem(AKey: string; AValue: string);
    procedure AddInternalItem(AKey: string; AValue: TPdfObject);
    procedure RemoveItem(AKey: string);
    property Items[Index: integer]: TPdfDictionaryElement read GetItems;
    property ItemCount: integer read GetItemCount;
    property ObjectMgr: TPdfObjectMgr read FObjectMgr;
  end;

  TPdfStream = class(TPdfObject)
  private
    FAttributes: TPdfDictionary;
    FStream: TStream;
  protected
    procedure InternalWriteStream(const AStream: TStream); override;
  public
    constructor CreateStream(AObjectMgr: TPdfObjectMgr);
    destructor Destroy; override;
    property Attributes: TPdfDictionary read FAttributes;
    property Stream: TStream read FStream;
  end;

  TPdfDate = string;

  TPdfXObject = class(TPdfStream);
  TPdfOutlines = class(TPdfDictionary);
  TPdfOutlineEntry = class(TPdfDictionary);

  EPdfInvalidValue = class(Exception);
  EPdfInvalidOperation = class(Exception);

  {*
   * utility functions.
   *}
  procedure _WriteString(const Value: string; AStream: TStream);
  function _StrToUnicodeHex(const Value: string): string;
  function _StrToHex(const Value: string): string;
  function _HasMultiByteString(const Value: string): boolean;
  function _DateTimeToPdfDate(ADate: TDateTime): TPdfDate;
  function _PdfDateToDateTime(AText: TPdfDate): TDateTime;
  function _EscapeText(const Value: string): string;
  function _GetTypeOf(ADictionary: TPdfDictionary): string;

implementation

{TPdfObject}

constructor TPdfObject.Create;
begin
  FObjectNumber := -1;
  FGenerationNumber := 0;
end;

procedure TPdfObject.SetObjectNumber(Value: integer);
begin
  // If object number is more then zero, the object is considered that indirect
  // object. otherwise, the object is considered that direct object.
  FObjectNumber := Value;
  if Value > 0 then
    FObjectType := otIndirectObject
  else
    FObjectType := otDirectObject;
end;

procedure TPdfObject.InternalWriteStream(const AStream: TStream);
begin
  // Abstruct method
end;

procedure TPdfObject.WriteToStream(const AStream: TStream);
var
  S: string;
begin
  // Write object to specified stream. If object is indirect object then write
  // references to stream.
  if FObjectType = otDirectObject then
    InternalWriteStream(AStream)
  else
  begin
    S := IntToStr(FObjectNumber) +
         ' ' +
         IntToStr(FGenerationNumber) +
         ' R';
    _WriteString(S, AStream);
  end;
end;

procedure TPdfObject.WriteValueToStream(const AStream: TStream);
var
  S: string;
begin
  // Write indirect object to specified stream. this method called by parent
  // object.
  if FObjectType <> otIndirectObject then
    raise EPdfInvalidOperation.Create('');
  S := IntToStr(FObjectNumber) +
       ' ' +
       IntToStr(FGenerationNumber) +
       ' obj' + 
       CRLF;
  _WriteString(S, AStream);
  InternalWriteStream(AStream);
  S := CRLF +
       'endobj' +
       #13#10;
  _WriteString(S, AStream);
end;

{ PdfVirtualObject }

constructor TPdfVirtualObject.Create;
begin
  raise Exception.Create('VirtualObject must be create by CreateVirtual method.');
end;

constructor TPdfVirtualObject.CreateVirtual(AObjectId: integer);
begin
  inherited Create;
  FObjectNumber := AObjectId;
  FObjectType := otVirtualObject;
end;

{ TPdfNumber }

procedure TPdfNumber.InternalWriteStream(const AStream: TStream);
begin
  _WriteString(IntToStr(FValue), AStream);
end;

constructor TPdfNumber.CreateNumber(AValue: integer);
begin
  Create;
  Value := AValue;
end;

{ TPdfReal }
procedure TPdfReal.InternalWriteStream(const AStream: TStream);
begin
  _WriteString(FloatToStr(FValue), AStream);
end;

constructor TPdfReal.CreateReal(AValue: double);
begin
  Create;
  Value := AValue;
end;

{ TPdfString }

procedure TPdfString.InternalWriteStream(const AStream: TStream);
var
  S: string;
begin
  // if the value has multibyte character, convert the value to hex code.
  // otherwise, escape characters.
  if _HasMultiByteString(FValue) then
    S := '<' + _StrToHex(FValue) + '>'
  else
    S := '(' + _EscapeText(FValue) + ')';
  _WriteString(S, AStream);
end;

constructor TPdfString.CreateString(AValue: string);
begin
  Create;
  Value := AValue;
end;

{ TPdfText }

procedure TPdfText.InternalWriteStream(const AStream: TStream);
var
  S: string;
begin
  // if the value has multibyte character, convert the value to hex unicode.
  // otherwise, escape characters.
  if _HasMultiByteString(FValue) then
    S := '<' + PDF_UNICODE_HEADER + _StrToUnicodeHex(FValue) + '>'
  else
    S := '(' + _EscapeText(FValue) + ')';
  _WriteString(S, AStream);
end;

constructor TPdfText.CreateText(AValue: string);
begin
  Create;
  Value := AValue;
end;

{ TPdfName }

function TPdfName.EscapeName(const Value: string): string;
const
  EscapeChars = ['%','(',')','<','>','[',']','{','}','/','#'];
var
  i: integer;
begin
  //  If text contains chars to need escape, replace text using <#> + hex value.
  result := '';
  for i := 1 to Length(Value) do
  begin
    if (Value[i] in EscapeChars) or
      (#33 > Value[i]) or
      (#126 < Value[i]) then
      result := result + '#'+ IntToHex(Ord(Value[i]), 02)
    else
      result := result + Value[i];
  end;
end;

procedure TPdfName.InternalWriteStream(const AStream: TStream);
var
  S: string;
begin
  // the name consists of </> + sequence of characters.
  S := '/' + EscapeName(FValue);
  _WriteString(S, AStream);
end;

constructor TPdfName.CreateName(AValue: string);
begin
  Create;
  Value := AValue;
end;

{ TPdfArray }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合久久久久久久久久久| 国产乱妇无码大片在线观看| 国产精品亚洲成人| 欧美无砖砖区免费| 国产精品久线在线观看| 黄色精品一二区| 欧美人妖巨大在线| 亚洲欧美激情视频在线观看一区二区三区 | 久久99精品久久久久久国产越南| 91性感美女视频| 国产精品污网站| 久久精品噜噜噜成人88aⅴ| 欧美日韩五月天| 中文字幕字幕中文在线中不卡视频| 激情av综合网| 日韩久久精品一区| 天天色综合成人网| 欧美亚洲禁片免费| 一区二区三区在线视频观看| 成人激情黄色小说| 国产欧美一区二区三区网站 | 亚洲成人免费观看| 色激情天天射综合网| 国产精品久久久久9999吃药| 国产69精品久久久久毛片| www成人在线观看| 狠狠色综合色综合网络| 欧美不卡一区二区三区四区| 日日摸夜夜添夜夜添国产精品 | av在线播放不卡| 国产精品免费免费| 岛国精品在线播放| 国产免费久久精品| 丁香婷婷综合激情五月色| 久久久精品免费网站| 国产真实乱对白精彩久久| 欧美tickling网站挠脚心| 蜜桃一区二区三区在线观看| 欧美一级生活片| 裸体一区二区三区| 精品日韩99亚洲| 激情六月婷婷久久| 国产日韩欧美一区二区三区乱码| 国产精选一区二区三区| 久久精品一区二区三区不卡| 国产传媒一区在线| 国产精品系列在线| 99视频精品全部免费在线| 亚洲色图20p| 欧美性猛交xxxx黑人交| 亚洲成人一二三| 91精品啪在线观看国产60岁| 日本欧美大码aⅴ在线播放| 日韩欧美在线网站| 国产一区二区三区四区五区美女| 久久精品亚洲麻豆av一区二区| 国产精品99久久久久久久vr| 亚洲国产精品av| 不卡电影免费在线播放一区| 亚洲视频一区二区免费在线观看| 欧美伊人久久久久久久久影院| 午夜免费久久看| 精品国产一区久久| 风间由美一区二区三区在线观看| ●精品国产综合乱码久久久久 | 国产在线视频不卡二| 国产日韩精品一区二区三区在线| 99视频国产精品| 亚洲成人激情自拍| 精品国产乱码久久久久久闺蜜| 国产成人在线观看免费网站| 综合网在线视频| 3d动漫精品啪啪1区2区免费| 韩国成人福利片在线播放| 国产精品久久久久久久久免费相片| 色婷婷久久一区二区三区麻豆| 亚洲成人www| 26uuu欧美| 在线影视一区二区三区| 蜜桃一区二区三区在线| 国产精品麻豆欧美日韩ww| 精品视频一区二区不卡| 麻豆免费看一区二区三区| 中文一区二区在线观看| 欧美色精品在线视频| 国产一区高清在线| 一区二区三区精品在线| 亚洲精品一区二区三区在线观看| 成人精品鲁一区一区二区| 香蕉久久一区二区不卡无毒影院 | 欧美吞精做爰啪啪高潮| 久久爱www久久做| 亚洲九九爱视频| 久久亚洲私人国产精品va媚药| 91麻豆成人久久精品二区三区| 日本 国产 欧美色综合| 中文字幕在线视频一区| 91精品国产乱码久久蜜臀| 成人高清视频在线| 奇米精品一区二区三区在线观看 | 综合亚洲深深色噜噜狠狠网站| 欧美一级午夜免费电影| 99re免费视频精品全部| 男女视频一区二区| 亚洲欧美另类小说视频| 26uuu久久天堂性欧美| 欧美在线影院一区二区| 国产成人免费在线视频| 日本不卡在线视频| 亚洲日本在线观看| 久久久精品日韩欧美| 欧美日本在线视频| fc2成人免费人成在线观看播放 | 夜夜嗨av一区二区三区四季av| 精品国产1区二区| 欧美日韩在线播放三区| 不卡在线视频中文字幕| 久久99精品网久久| 首页综合国产亚洲丝袜| 亚洲欧美另类图片小说| 国产精品视频线看| www国产亚洲精品久久麻豆| 欧美日韩免费视频| 色综合久久久久久久| 国产不卡免费视频| 精品制服美女久久| 三级亚洲高清视频| 夜夜夜精品看看| 日韩码欧中文字| 日本一二三不卡| 久久人人97超碰com| 精品美女被调教视频大全网站| 欧美午夜免费电影| 91美女精品福利| 成人福利视频在线看| 国产一区999| 精品一区二区综合| 蜜臀久久99精品久久久久久9| 午夜电影网一区| 亚洲一区二区黄色| 亚洲永久免费视频| 最新中文字幕一区二区三区| 中文字幕免费观看一区| 久久精品视频一区二区| 久久久精品天堂| 国产欧美一区二区三区在线老狼| 久久伊99综合婷婷久久伊| 久久这里只有精品视频网| 欧美刺激脚交jootjob| 欧美不卡一区二区三区四区| 欧美变态凌虐bdsm| 日韩精品一区二区三区视频播放 | 欧美乱熟臀69xxxxxx| 在线观看av不卡| 欧美在线视频全部完| 在线观看一区日韩| 欧美性生交片4| 欧美日韩亚洲高清一区二区| 欧美喷潮久久久xxxxx| 宅男噜噜噜66一区二区66| 91精品婷婷国产综合久久 | 亚洲人成精品久久久久久| 国产精品美女一区二区三区 | 国产精品不卡一区二区三区| 国产精品久久久久久一区二区三区| 国产精品色噜噜| 亚洲视频在线观看一区| 亚洲一区二区三区中文字幕| 在线观看免费亚洲| 欧美三级日韩在线| 91麻豆精品国产自产在线| 日韩精品中文字幕在线不卡尤物 | 欧美一区二区三区日韩视频| 精品少妇一区二区三区日产乱码| 久久久久青草大香线综合精品| 久久久777精品电影网影网| 国产精品久久久久久久蜜臀| 一区二区在线看| 蜜臀av性久久久久蜜臀aⅴ| 国产一区二区三区最好精华液| 成人精品鲁一区一区二区| 91精品1区2区| 欧美一区二区三区在线视频| 欧美精品一区二区三区久久久| 国产亚洲成aⅴ人片在线观看| 综合久久综合久久| 日韩中文字幕91| 国产老妇另类xxxxx| 色综合久久久久网| 欧美一激情一区二区三区| 国产亚洲一区字幕| 亚洲精选一二三| 日本va欧美va精品发布| 粉嫩久久99精品久久久久久夜 | 国产主播一区二区| 色婷婷精品久久二区二区蜜臀av| 欧美精品丝袜久久久中文字幕| 久久影院视频免费| 亚洲一区二区三区在线播放| 极品尤物av久久免费看|