[This is preliminary documentation and is subject to change.]
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. These users must be granted permission on all tables to:
- CONNECT
- DELETE
- INSERT
- SELECT
- UPDATE
Table Creation
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) 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]
GOdoss Table Creation
This table is used to help prevent Denial Of Service (DOS) attacks on the server via the RAD PDF HttpHandler.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[doss](
[dosId] [int] IDENTITY(1,1) NOT NULL,
[dosIp] [varchar](39) NOT NULL,
[dosDate] [datetime] NOT NULL,
CONSTRAINT [PK_doss] PRIMARY KEY CLUSTERED
(
[dosId] 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
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] 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
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,
[pdfFilename] [nvarchar](200) NOT NULL,
[pdfData] [image] NOT NULL,
[pdfDataLength] [int] NOT NULL,
[pdfDataHash] [binary](64) NOT NULL,
[pdfXml] [ntext] NOT NULL,
[pdfText] [ntext] 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 OFFpges 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,
[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