RAD PDF requires access to a database
Database Setup
RAD PDF uses a database which can be accessed by the ASP.NET user as well as the LocalSystem account (or other user account which the RAD PDF System Service has designated to "Log In As"). These users must be granted permission on all tables to:
- CONNECT
- DELETE
- INSERT
- SELECT
- UPDATE
Table Creation
This section contains the following subsections.
RAD PDF requires 5 dbo tables. These tables are explained below and can be created with the provided SQL scripts.
Note: These scripts do not create indices for these tables which may be required for high volume implementations
docs Table Creation
This table stores all information about documents which have been opened by users.
Note: Documents are not the same as PDFs in RAD PDF. PDFs refer to the actual PDF files on the server. Documents are instances of these PDFs, each allowing allowing one user access. This allows multiple documents to exist on the server which represent the same PDF file without excessive data duplication.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[docs](
[docID] [int] IDENTITY(1,1) NOT NULL,
[pdfID] [int] NOT NULL,
[docDate] [datetime] NOT NULL,
[docDateModified] [datetime] NULL,
[docStatus] [int] NOT NULL,
[docSettings] [int] NOT NULL,
[docFileName] [nvarchar](200) NOT NULL,
[docXml] [ntext] NOT NULL,
[docOutputData] [image] NULL,
CONSTRAINT [PK_docs] PRIMARY KEY CLUSTERED
(
[docID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GOkeys Table Creation
This table is used to store document keys (long hashes similar to cookie session hashes) used to access documents
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[keys](
[keyID] [int] IDENTITY(1,1) NOT NULL,
[docID] [int] NOT NULL,
[keyData] [char](25) NOT NULL,
[keyExpires] [datetime] NOT NULL,
[keySettings] [int] NOT NULL,
CONSTRAINT [PK_keys] PRIMARY KEY CLUSTERED
(
[keyID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GOobjs Table Creation
This table is used to store document objects referenced by documents
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[objs](
[objID] [int] IDENTITY(1,1) NOT NULL,
[docID] [int] NOT NULL,
[objType] [int] NOT NULL,
[objSettings] [int] NOT NULL,
[objData] [image] NOT NULL,
[objDataLength] [int] NOT NULL,
CONSTRAINT [PK_objs] PRIMARY KEY CLUSTERED
(
[objID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GOpdfs Table Creation
This table is used to store all opened PDF files
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[pdfs](
[pdfID] [int] IDENTITY(1,1) NOT NULL,
[pdfDate] [datetime] NOT NULL,
[pdfStatus] [int] NOT NULL,
[pdfVersion] [int] NOT NULL,
[pdfPageLoaded] [int] NOT NULL,
[pdfPageCount] [int] NOT NULL,
[pdfUserRights] [int] NOT NULL,
[pdfDpi] [int] NOT NULL,
[pdfDpiHigh] [int] NOT NULL,
[pdfData] [image] NOT NULL,
[pdfDataLength] [int] NOT NULL,
[pdfDataHash] [binary](64) NOT NULL,
[pdfPassHash] [binary](64) NULL,
[pdfXml] [ntext] NOT NULL,
[pdfText] [ntext] NOT NULL,
CONSTRAINT [PK_pdfs] PRIMARY KEY CLUSTERED
(
[pdfID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GOpges Table Creation
This table is used to store the rendered representations of a document's pages
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[pges](
[pgeID] [int] IDENTITY(1,1) NOT NULL,
[pdfID] [int] NOT NULL,
[docID] [int] NOT NULL,
[keyID] [int] NOT NULL,
[pgeDate] [datetime] NOT NULL,
[pgeStatus] [int] NOT NULL,
[pgeNumber] [int] NOT NULL,
[pgeImageType] [int] NOT NULL,
[pgeImageData] [image] NULL,
CONSTRAINT [PK_pges] PRIMARY KEY CLUSTERED
(
[pgeID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO