Initial commit

This commit is contained in:
2020-10-21 10:43:18 +02:00
commit 56bd02798f
5848 changed files with 2659025 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,29 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "PDFView", "PDFView\PDFView.vbproj", "{170D7D1B-61B9-4E8B-9CD3-88350725379F}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SamplePDFViewer", "SamplePDFViewer\SamplePDFViewer.vbproj", "{ECEEFA4B-5656-4286-A094-CEBB4C5E3760}"
ProjectSection(ProjectDependencies) = postProject
{170D7D1B-61B9-4E8B-9CD3-88350725379F} = {170D7D1B-61B9-4E8B-9CD3-88350725379F}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{170D7D1B-61B9-4E8B-9CD3-88350725379F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{170D7D1B-61B9-4E8B-9CD3-88350725379F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{170D7D1B-61B9-4E8B-9CD3-88350725379F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{170D7D1B-61B9-4E8B-9CD3-88350725379F}.Release|Any CPU.Build.0 = Release|Any CPU
{ECEEFA4B-5656-4286-A094-CEBB4C5E3760}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ECEEFA4B-5656-4286-A094-CEBB4C5E3760}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ECEEFA4B-5656-4286-A094-CEBB4C5E3760}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ECEEFA4B-5656-4286-A094-CEBB4C5E3760}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,215 @@
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Drawing.Printing
Public Class AFPDFLibUtil
'This uses an XPDF wrapper written by Jose Antonio Sandoval Soria of Guadalajara, México
'The source is available at http://www.codeproject.com/KB/files/xpdf_csharp.aspx
'
'I have ported over to VB.NET select functionality from the C# PDF viewer in the above project
Const RENDER_DPI As Integer = 200
Const PRINT_DPI As Integer = 300
Public Shared Function GetOptimalDPI(ByRef pdfDoc As PDFLibNet.PDFWrapper, ByRef oPictureBox As PictureBox) As Integer
GetOptimalDPI = 0
If pdfDoc IsNot Nothing Then
If pdfDoc.PageWidth > 0 And pdfDoc.PageHeight > 0 Then
Dim DPIScalePercent As Single = 72 / pdfDoc.RenderDPI
Dim picHeight As Integer = oPictureBox.Height
Dim picWidth As Integer = oPictureBox.Width
Dim docHeight As Integer = pdfDoc.PageHeight
Dim docWidth As Integer = pdfDoc.PageWidth
Dim dummyPicBox As New PictureBox
dummyPicBox.Size = oPictureBox.Size
If (picWidth > picHeight And docWidth < docHeight) Or (picWidth < picHeight And docWidth > docHeight) Then
dummyPicBox.Width = picHeight
dummyPicBox.Height = picWidth
End If
Dim HScale As Single = dummyPicBox.Width / (pdfDoc.PageWidth * DPIScalePercent)
Dim VScale As Single = dummyPicBox.Height / (pdfDoc.PageHeight * DPIScalePercent)
dummyPicBox.Dispose()
If VScale > HScale Then
GetOptimalDPI = Math.Floor(72 * HScale)
Else
GetOptimalDPI = Math.Floor(72 * VScale)
End If
End If
End If
End Function
Public Shared Function GetImageFromPDF(ByRef pdfDoc As PDFLibNet.PDFWrapper, ByVal PageNumber As Integer, Optional ByVal DPI As Integer = RENDER_DPI) As System.Drawing.Image
GetImageFromPDF = Nothing
Try
If pdfDoc IsNot Nothing Then
pdfDoc.CurrentPage = PageNumber
pdfDoc.CurrentX = 0
pdfDoc.CurrentY = 0
If DPI < 1 Then DPI = RENDER_DPI
pdfDoc.RenderDPI = DPI
Dim oPictureBox As New PictureBox
pdfDoc.RenderPage(oPictureBox.Handle)
GetImageFromPDF = Render(pdfDoc)
oPictureBox.Dispose()
End If
Catch ex As Exception
Throw ex
End Try
End Function
Public Shared Function Render(ByRef pdfDoc As PDFLibNet.PDFWrapper) As System.Drawing.Bitmap
Try
If pdfDoc IsNot Nothing Then
Dim backbuffer As System.Drawing.Bitmap = New Bitmap(pdfDoc.PageWidth, pdfDoc.PageHeight)
pdfDoc.ClientBounds = New Rectangle(0, 0, pdfDoc.PageWidth, pdfDoc.PageHeight)
Dim g As Graphics = Graphics.FromImage(backbuffer)
Using g
Dim hdc As IntPtr = g.GetHdc()
pdfDoc.DrawPageHDC(hdc)
g.ReleaseHdc()
End Using
g.Dispose()
Return backbuffer
End If
Catch ex As Exception
Throw ex
Return Nothing
End Try
Return Nothing
End Function
Public Shared Sub ExportPDF(ByRef pdfDoc As PDFLibNet.PDFWrapper, ByVal fileName As String, Optional ByVal startPage As Integer = 1, Optional ByVal endPage As Integer = 0)
If Not Nothing Is pdfDoc Then
If endPage = 0 Or endPage > pdfDoc.PageCount Then
endPage = pdfDoc.PageCount
End If
Try
If fileName.EndsWith(".ps") Then
pdfDoc.PrintToFile(fileName, startPage, endPage)
ElseIf fileName.EndsWith(".jpg") Then
pdfDoc.ExportJpg(fileName, 70)
ElseIf fileName.EndsWith(".txt") Then
pdfDoc.ExportText(fileName, startPage, endPage, True, True)
ElseIf fileName.EndsWith(".html") Then
pdfDoc.ExportHtml(fileName, startPage, endPage, True, True, False)
End If
Catch ex As Exception
MessageBox.Show(ex.ToString())
End Try
End If
End Sub
Public Shared Function FillTree(ByRef tvwOutline As TreeView, ByRef pdfDoc As PDFLibNet.PDFWrapper) As Boolean
FillTree = False
tvwOutline.Nodes.Clear()
For Each ol As PDFLibNet.OutlineItem In pdfDoc.Outline
FillTree = True
Dim tn As New TreeNode(ol.Title)
tn.Tag = ol
tvwOutline.Nodes.Add(tn)
If ol.KidsCount > 0 Then
FillTreeRecursive(ol.Childrens, tn)
End If
Next
End Function
Public Shared Sub FillTreeRecursive(ByVal olParent As PDFLibNet.OutlineItemCollection(Of PDFLibNet.OutlineItem), ByVal treeNode As TreeNode)
For Each ol As PDFLibNet.OutlineItem In olParent
Dim tn As New TreeNode(ol.Title)
tn.Tag = ol
treeNode.Nodes.Add(tn)
If ol.KidsCount > 0 Then
FillTreeRecursive(ol.Childrens, tn)
End If
Next
End Sub
Public Shared Function BuildJavaScriptArray(ByRef pdfDoc As PDFLibNet.PDFWrapper) As String
Dim pageCount As Integer = pdfDoc.PageCount
BuildJavaScriptArray = "var myPages=new Array("
For i As Integer = 1 To pageCount
BuildJavaScriptArray &= """images/page" & i & ".png"",)"
Next
BuildJavaScriptArray = BuildJavaScriptArray.Substring(0, BuildJavaScriptArray.Length - 2)
BuildJavaScriptArray &= ");" & vbCrLf & "var myPageCount=" & pageCount & ";"
End Function
Public Shared Function BuildHTMLBookmarks(ByRef pdfDoc As PDFLibNet.PDFWrapper) As String
Dim pageCount As Integer = pdfDoc.PageCount
If pdfDoc.Outline.Count <= 0 Then
StartPageList:
BuildHTMLBookmarks = "<!--PageNumberOnly--><ul>"
For i As Integer = 1 To pageCount
BuildHTMLBookmarks &= "<li><a href=""javascript:changeImage('images/page" & i & ".png')"">Page " & i & "</a></li>"
Next
BuildHTMLBookmarks &= "</ul>"
Exit Function
Else
BuildHTMLBookmarks = ""
FillHTMLTreeRecursive(pdfDoc.Outline, BuildHTMLBookmarks, pdfDoc)
If System.Text.RegularExpressions.Regex.IsMatch(BuildHTMLBookmarks, "\d") = False Then
BuildHTMLBookmarks = ""
GoTo StartPageList
End If
Exit Function
End If
End Function
Public Shared Sub FillHTMLTreeRecursive(ByVal olParent As PDFLibNet.OutlineItemCollection(Of PDFLibNet.OutlineItem), ByRef htmlString As String, ByRef pdfDoc As PDFLibNet.PDFWrapper)
htmlString &= "<ul>"
For Each ol As PDFLibNet.OutlineItem In olParent
htmlString &= "<li><a href=""javascript:changeImage('images/page" & ol.Destination.Page & ".png')"">" & Web.HttpUtility.HtmlEncode(ol.Title) & "</a></li>"
If ol.KidsCount > 0 Then
FillHTMLTreeRecursive(ol.Childrens, htmlString, pdfDoc)
End If
Next
htmlString &= "</ul>"
End Sub
End Class
Public Class PDFOutline
Public Title As String
Public Item As PDFLibNet.OutlineItem
Friend _doc As PDFLibNet.PDFWrapper = Nothing
Friend _children As List(Of PDFOutline)
Public ReadOnly Property Children() As List(Of PDFOutline)
Get
Return _children
End Get
End Property
Friend Sub New(ByVal title__1 As String, ByVal outlineItem As PDFLibNet.OutlineItem, ByVal doc As PDFLibNet.PDFWrapper)
Title = title__1
Item = outlineItem
_doc = doc
End Sub
End Class
Public Class SearchArgs
Inherits EventArgs
Public Text As String
Public FromBegin As Boolean
Public Exact As Boolean
Public WholeDoc As Boolean
Public FindNext As Boolean
Public Up As Boolean
Friend Sub New(ByVal text__1 As String, ByVal frombegin__2 As Boolean, ByVal exact__3 As Boolean, ByVal wholedoc__4 As Boolean, ByVal findnext__5 As Boolean, ByVal up__6 As Boolean)
Text = text__1
FromBegin = frombegin__2
Exact = exact__3
WholeDoc = wholedoc__4
FindNext = findnext__5
Up = up__6
End Sub
End Class

View File

@@ -0,0 +1,299 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class ExportImageOptions
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.rbPDF = New System.Windows.Forms.RadioButton
Me.GroupBox3 = New System.Windows.Forms.GroupBox
Me.cbPageSize = New System.Windows.Forms.ComboBox
Me.Label3 = New System.Windows.Forms.Label
Me.GroupBox2 = New System.Windows.Forms.GroupBox
Me.nuDown = New System.Windows.Forms.NumericUpDown
Me.Label2 = New System.Windows.Forms.Label
Me.nuStart = New System.Windows.Forms.NumericUpDown
Me.Label1 = New System.Windows.Forms.Label
Me.btCancel = New System.Windows.Forms.Button
Me.btOK = New System.Windows.Forms.Button
Me.SaveFileDialog1 = New System.Windows.Forms.SaveFileDialog
Me.GroupBox4 = New System.Windows.Forms.GroupBox
Me.cbLanguage = New System.Windows.Forms.ComboBox
Me.cbOCR = New System.Windows.Forms.CheckBox
Me.GroupBox5 = New System.Windows.Forms.GroupBox
Me.tbUserPass = New System.Windows.Forms.TextBox
Me.tbOwnerPass = New System.Windows.Forms.TextBox
Me.Label4 = New System.Windows.Forms.Label
Me.Label5 = New System.Windows.Forms.Label
Me.GroupBox1.SuspendLayout()
Me.GroupBox3.SuspendLayout()
Me.GroupBox2.SuspendLayout()
CType(Me.nuDown, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.nuStart, System.ComponentModel.ISupportInitialize).BeginInit()
Me.GroupBox4.SuspendLayout()
Me.GroupBox5.SuspendLayout()
Me.SuspendLayout()
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.rbPDF)
Me.GroupBox1.Location = New System.Drawing.Point(12, 12)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(260, 49)
Me.GroupBox1.TabIndex = 1
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "File Format"
'
'rbPDF
'
Me.rbPDF.AutoSize = True
Me.rbPDF.Checked = True
Me.rbPDF.Location = New System.Drawing.Point(7, 19)
Me.rbPDF.Name = "rbPDF"
Me.rbPDF.Size = New System.Drawing.Size(46, 17)
Me.rbPDF.TabIndex = 0
Me.rbPDF.TabStop = True
Me.rbPDF.Tag = "Portable Document Format (*.pdf)|*.pdf"
Me.rbPDF.Text = "PDF"
Me.rbPDF.UseVisualStyleBackColor = True
'
'GroupBox3
'
Me.GroupBox3.Controls.Add(Me.cbPageSize)
Me.GroupBox3.Controls.Add(Me.Label3)
Me.GroupBox3.Location = New System.Drawing.Point(12, 67)
Me.GroupBox3.Name = "GroupBox3"
Me.GroupBox3.Size = New System.Drawing.Size(260, 53)
Me.GroupBox3.TabIndex = 6
Me.GroupBox3.TabStop = False
Me.GroupBox3.Text = "PDF Options"
'
'cbPageSize
'
Me.cbPageSize.FormattingEnabled = True
Me.cbPageSize.Location = New System.Drawing.Point(70, 21)
Me.cbPageSize.Name = "cbPageSize"
Me.cbPageSize.Size = New System.Drawing.Size(121, 21)
Me.cbPageSize.TabIndex = 2
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(6, 24)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(58, 13)
Me.Label3.TabIndex = 1
Me.Label3.Text = "Page Size:"
'
'GroupBox2
'
Me.GroupBox2.Controls.Add(Me.nuDown)
Me.GroupBox2.Controls.Add(Me.Label2)
Me.GroupBox2.Controls.Add(Me.nuStart)
Me.GroupBox2.Controls.Add(Me.Label1)
Me.GroupBox2.Location = New System.Drawing.Point(13, 270)
Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(260, 57)
Me.GroupBox2.TabIndex = 5
Me.GroupBox2.TabStop = False
Me.GroupBox2.Text = "Page Range"
'
'nuDown
'
Me.nuDown.Location = New System.Drawing.Point(168, 24)
Me.nuDown.Minimum = New Decimal(New Integer() {1, 0, 0, 0})
Me.nuDown.Name = "nuDown"
Me.nuDown.Size = New System.Drawing.Size(48, 20)
Me.nuDown.TabIndex = 3
Me.nuDown.Value = New Decimal(New Integer() {1, 0, 0, 0})
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(120, 26)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(43, 13)
Me.Label2.TabIndex = 2
Me.Label2.Text = "to page"
'
'nuStart
'
Me.nuStart.Location = New System.Drawing.Point(65, 24)
Me.nuStart.Minimum = New Decimal(New Integer() {1, 0, 0, 0})
Me.nuStart.Name = "nuStart"
Me.nuStart.Size = New System.Drawing.Size(48, 20)
Me.nuStart.TabIndex = 1
Me.nuStart.Value = New Decimal(New Integer() {1, 0, 0, 0})
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(6, 26)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(57, 13)
Me.Label1.TabIndex = 0
Me.Label1.Text = "From page"
'
'btCancel
'
Me.btCancel.Location = New System.Drawing.Point(117, 333)
Me.btCancel.Name = "btCancel"
Me.btCancel.Size = New System.Drawing.Size(75, 23)
Me.btCancel.TabIndex = 8
Me.btCancel.Text = "Cancel"
Me.btCancel.UseVisualStyleBackColor = True
'
'btOK
'
Me.btOK.Location = New System.Drawing.Point(198, 333)
Me.btOK.Name = "btOK"
Me.btOK.Size = New System.Drawing.Size(75, 23)
Me.btOK.TabIndex = 7
Me.btOK.Text = "OK"
Me.btOK.UseVisualStyleBackColor = True
'
'GroupBox4
'
Me.GroupBox4.Controls.Add(Me.cbLanguage)
Me.GroupBox4.Controls.Add(Me.cbOCR)
Me.GroupBox4.Location = New System.Drawing.Point(12, 128)
Me.GroupBox4.Name = "GroupBox4"
Me.GroupBox4.Size = New System.Drawing.Size(260, 53)
Me.GroupBox4.TabIndex = 7
Me.GroupBox4.TabStop = False
Me.GroupBox4.Text = "OCR Options"
'
'cbLanguage
'
Me.cbLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cbLanguage.FormattingEnabled = True
Me.cbLanguage.Items.AddRange(New Object() {"English"})
Me.cbLanguage.Location = New System.Drawing.Point(126, 17)
Me.cbLanguage.Name = "cbLanguage"
Me.cbLanguage.Size = New System.Drawing.Size(121, 21)
Me.cbLanguage.TabIndex = 3
'
'cbOCR
'
Me.cbOCR.AutoSize = True
Me.cbOCR.Location = New System.Drawing.Point(10, 19)
Me.cbOCR.Name = "cbOCR"
Me.cbOCR.Size = New System.Drawing.Size(110, 17)
Me.cbOCR.TabIndex = 2
Me.cbOCR.Text = "Make Searchable"
Me.cbOCR.UseVisualStyleBackColor = True
'
'GroupBox5
'
Me.GroupBox5.Controls.Add(Me.Label5)
Me.GroupBox5.Controls.Add(Me.Label4)
Me.GroupBox5.Controls.Add(Me.tbOwnerPass)
Me.GroupBox5.Controls.Add(Me.tbUserPass)
Me.GroupBox5.Location = New System.Drawing.Point(13, 188)
Me.GroupBox5.Name = "GroupBox5"
Me.GroupBox5.Size = New System.Drawing.Size(259, 76)
Me.GroupBox5.TabIndex = 9
Me.GroupBox5.TabStop = False
Me.GroupBox5.Text = "Password Options"
'
'tbUserPass
'
Me.tbUserPass.Location = New System.Drawing.Point(64, 19)
Me.tbUserPass.Name = "tbUserPass"
Me.tbUserPass.Size = New System.Drawing.Size(182, 20)
Me.tbUserPass.TabIndex = 0
'
'tbOwnerPass
'
Me.tbOwnerPass.Location = New System.Drawing.Point(64, 46)
Me.tbOwnerPass.Name = "tbOwnerPass"
Me.tbOwnerPass.Size = New System.Drawing.Size(182, 20)
Me.tbOwnerPass.TabIndex = 1
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(23, 22)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(29, 13)
Me.Label4.TabIndex = 2
Me.Label4.Text = "User"
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(23, 49)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(38, 13)
Me.Label5.TabIndex = 3
Me.Label5.Text = "Owner"
'
'ExportImageOptions
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(284, 363)
Me.Controls.Add(Me.GroupBox5)
Me.Controls.Add(Me.GroupBox4)
Me.Controls.Add(Me.btCancel)
Me.Controls.Add(Me.btOK)
Me.Controls.Add(Me.GroupBox3)
Me.Controls.Add(Me.GroupBox2)
Me.Controls.Add(Me.GroupBox1)
Me.Name = "ExportImageOptions"
Me.Text = "Export Image Options"
Me.GroupBox1.ResumeLayout(False)
Me.GroupBox1.PerformLayout()
Me.GroupBox3.ResumeLayout(False)
Me.GroupBox3.PerformLayout()
Me.GroupBox2.ResumeLayout(False)
Me.GroupBox2.PerformLayout()
CType(Me.nuDown, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.nuStart, System.ComponentModel.ISupportInitialize).EndInit()
Me.GroupBox4.ResumeLayout(False)
Me.GroupBox4.PerformLayout()
Me.GroupBox5.ResumeLayout(False)
Me.GroupBox5.PerformLayout()
Me.ResumeLayout(False)
End Sub
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents rbPDF As System.Windows.Forms.RadioButton
Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
Friend WithEvents cbPageSize As System.Windows.Forms.ComboBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
Friend WithEvents nuDown As System.Windows.Forms.NumericUpDown
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents nuStart As System.Windows.Forms.NumericUpDown
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents btCancel As System.Windows.Forms.Button
Friend WithEvents btOK As System.Windows.Forms.Button
Friend WithEvents SaveFileDialog1 As System.Windows.Forms.SaveFileDialog
Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox
Friend WithEvents cbLanguage As System.Windows.Forms.ComboBox
Friend WithEvents cbOCR As System.Windows.Forms.CheckBox
Friend WithEvents GroupBox5 As System.Windows.Forms.GroupBox
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents tbOwnerPass As System.Windows.Forms.TextBox
Friend WithEvents tbUserPass As System.Windows.Forms.TextBox
End Class

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="SaveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,104 @@
Imports System.Windows.Forms
Public Class ExportImageOptions
Dim mImgFileNames As String()
Dim mFilter As String = ""
Dim IsMultiple As Boolean = False
Public SavedFileName As String = ""
Public Sub New(ByVal imgFileNames As String())
' This call is required by the Windows Form Designer.
InitializeComponent()
If imgFileNames.Length = 1 Then
Dim pageCount As Integer = ImageUtil.GetImageFrameCount(imgFileNames(0))
If pageCount > 1 Then
nuStart.Maximum = pageCount
nuStart.Value = 1
nuDown.Maximum = pageCount
nuDown.Value = pageCount
Else
DisablePageRange()
End If
Else
DisablePageRange()
End If
mImgFileNames = imgFileNames
SaveFileDialog1.Filter = rbPDF.Tag
End Sub
Private Sub DisablePageRange()
nuStart.Maximum = 0
nuStart.Value = 0
nuDown.Maximum = 0
nuDown.Value = 0
GroupBox2.Visible = False
End Sub
Private Sub ExportImageOptions_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
LoadPageSizes()
LoadLanguages()
End Sub
Private Sub LoadPageSizes()
Dim hash As New List(Of DictionaryEntry)
hash.Add(New DictionaryEntry("Letter", iTextSharp.text.PageSize.LETTER))
hash.Add(New DictionaryEntry("Legal", iTextSharp.text.PageSize.LEGAL))
hash.Add(New DictionaryEntry("Ledger", iTextSharp.text.PageSize._11X17))
hash.Add(New DictionaryEntry("Executive", iTextSharp.text.PageSize.EXECUTIVE))
hash.Add(New DictionaryEntry("A4", iTextSharp.text.PageSize.A4))
hash.Add(New DictionaryEntry("B4", iTextSharp.text.PageSize.B4))
hash.Add(New DictionaryEntry("A3", iTextSharp.text.PageSize.A3))
cbPageSize.DataSource = hash
cbPageSize.DisplayMember = "Key"
End Sub
Private Sub LoadLanguages()
'Make sure all of the language files are in the \tessdata directory
Dim hash As New List(Of DictionaryEntry)
hash.Add(New DictionaryEntry("English", TesseractOCR.Language.English))
'hash.Add(New DictionaryEntry("Basque", TesseractOCR.Language.Basque))
'hash.Add(New DictionaryEntry("Dutch", TesseractOCR.Language.Dutch))
'hash.Add(New DictionaryEntry("Fraktur", TesseractOCR.Language.Fraktur))
'hash.Add(New DictionaryEntry("French", TesseractOCR.Language.French))
'hash.Add(New DictionaryEntry("German", TesseractOCR.Language.German))
'hash.Add(New DictionaryEntry("Italian", TesseractOCR.Language.Italian))
'hash.Add(New DictionaryEntry("Portuguese", TesseractOCR.Language.Portuguese))
'hash.Add(New DictionaryEntry("Spanish", TesseractOCR.Language.Spanish))
'hash.Add(New DictionaryEntry("Vietnamese", TesseractOCR.Language.Vietnamese))
cbLanguage.DataSource = hash
cbLanguage.DisplayMember = "Key"
End Sub
Private Sub btCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btCancel.Click
Me.Hide()
End Sub
Private Sub nuStart_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles nuStart.ValueChanged
If nuStart.Value > nuDown.Value Then
nuStart.Value = nuDown.Value
End If
End Sub
Private Sub nuDown_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles nuDown.ValueChanged
If nuDown.Value < nuStart.Value Then
nuDown.Value = nuStart.Value
End If
End Sub
Private Sub btOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btOK.Click
If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
Windows.Forms.Cursor.Current = Windows.Forms.Cursors.WaitCursor
Dim filename As String = SaveFileDialog1.FileName
If filename.EndsWith(".pdf") Then
iTextSharpUtil.GraphicListToPDF(mImgFileNames, SaveFileDialog1.FileName, cbPageSize.SelectedValue.Value, IIf(cbOCR.Checked, cbLanguage.SelectedValue.Value, ""), nuStart.Value, nuDown.Value, tbUserPass.Text, tbOwnerPass.Text)
SavedFileName = SaveFileDialog1.FileName
End If
Windows.Forms.Cursor.Current = Windows.Forms.Cursors.Default
End If
Me.Hide()
End Sub
End Class

View File

@@ -0,0 +1,304 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class ExportOptions
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.rbHtmlImage = New System.Windows.Forms.RadioButton
Me.rbTIFF = New System.Windows.Forms.RadioButton
Me.rbPNG = New System.Windows.Forms.RadioButton
Me.rbJpeg = New System.Windows.Forms.RadioButton
Me.rbText = New System.Windows.Forms.RadioButton
Me.rbHtml = New System.Windows.Forms.RadioButton
Me.rbPostscript = New System.Windows.Forms.RadioButton
Me.GroupBox2 = New System.Windows.Forms.GroupBox
Me.nuDown = New System.Windows.Forms.NumericUpDown
Me.Label2 = New System.Windows.Forms.Label
Me.nuStart = New System.Windows.Forms.NumericUpDown
Me.Label1 = New System.Windows.Forms.Label
Me.btOK = New System.Windows.Forms.Button
Me.btCancel = New System.Windows.Forms.Button
Me.SaveFileDialog1 = New System.Windows.Forms.SaveFileDialog
Me.GroupBox3 = New System.Windows.Forms.GroupBox
Me.Label4 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.nuDPI = New System.Windows.Forms.NumericUpDown
Me.GroupBox1.SuspendLayout()
Me.GroupBox2.SuspendLayout()
CType(Me.nuDown, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.nuStart, System.ComponentModel.ISupportInitialize).BeginInit()
Me.GroupBox3.SuspendLayout()
CType(Me.nuDPI, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.rbHtmlImage)
Me.GroupBox1.Controls.Add(Me.rbTIFF)
Me.GroupBox1.Controls.Add(Me.rbPNG)
Me.GroupBox1.Controls.Add(Me.rbJpeg)
Me.GroupBox1.Controls.Add(Me.rbText)
Me.GroupBox1.Controls.Add(Me.rbHtml)
Me.GroupBox1.Controls.Add(Me.rbPostscript)
Me.GroupBox1.Location = New System.Drawing.Point(12, 12)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(260, 114)
Me.GroupBox1.TabIndex = 0
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "File Format"
'
'rbHtmlImage
'
Me.rbHtmlImage.AutoSize = True
Me.rbHtmlImage.Location = New System.Drawing.Point(6, 88)
Me.rbHtmlImage.Name = "rbHtmlImage"
Me.rbHtmlImage.Size = New System.Drawing.Size(128, 17)
Me.rbHtmlImage.TabIndex = 6
Me.rbHtmlImage.TabStop = True
Me.rbHtmlImage.Tag = "HTML (*.html)|*.html"
Me.rbHtmlImage.Text = "HTML (Image Viewer)"
Me.rbHtmlImage.UseVisualStyleBackColor = True
'
'rbTIFF
'
Me.rbTIFF.AutoSize = True
Me.rbTIFF.Location = New System.Drawing.Point(139, 42)
Me.rbTIFF.Name = "rbTIFF"
Me.rbTIFF.Size = New System.Drawing.Size(47, 17)
Me.rbTIFF.TabIndex = 5
Me.rbTIFF.TabStop = True
Me.rbTIFF.Tag = "TIFF (*.tif)|*.tif"
Me.rbTIFF.Text = "TIFF"
Me.rbTIFF.UseVisualStyleBackColor = True
'
'rbPNG
'
Me.rbPNG.AutoSize = True
Me.rbPNG.Location = New System.Drawing.Point(6, 65)
Me.rbPNG.Name = "rbPNG"
Me.rbPNG.Size = New System.Drawing.Size(48, 17)
Me.rbPNG.TabIndex = 4
Me.rbPNG.TabStop = True
Me.rbPNG.Tag = "PNG (*.png)|*.png"
Me.rbPNG.Text = "PNG"
Me.rbPNG.UseVisualStyleBackColor = True
'
'rbJpeg
'
Me.rbJpeg.AutoSize = True
Me.rbJpeg.Location = New System.Drawing.Point(139, 19)
Me.rbJpeg.Name = "rbJpeg"
Me.rbJpeg.Size = New System.Drawing.Size(55, 17)
Me.rbJpeg.TabIndex = 3
Me.rbJpeg.TabStop = True
Me.rbJpeg.Tag = "JPEG (*.jpg)|*.jpg"
Me.rbJpeg.Text = "JPEG "
Me.rbJpeg.UseVisualStyleBackColor = True
'
'rbText
'
Me.rbText.AutoSize = True
Me.rbText.Location = New System.Drawing.Point(6, 42)
Me.rbText.Name = "rbText"
Me.rbText.Size = New System.Drawing.Size(72, 17)
Me.rbText.TabIndex = 2
Me.rbText.TabStop = True
Me.rbText.Tag = "Plain Text (*.txt)|*.txt"
Me.rbText.Text = "Plain Text"
Me.rbText.UseVisualStyleBackColor = True
'
'rbHtml
'
Me.rbHtml.AutoSize = True
Me.rbHtml.Location = New System.Drawing.Point(139, 65)
Me.rbHtml.Name = "rbHtml"
Me.rbHtml.Size = New System.Drawing.Size(115, 17)
Me.rbHtml.TabIndex = 1
Me.rbHtml.TabStop = True
Me.rbHtml.Tag = "HTML (*.html)|*.html"
Me.rbHtml.Text = "HTML (Web Page)"
Me.rbHtml.UseVisualStyleBackColor = True
'
'rbPostscript
'
Me.rbPostscript.AutoSize = True
Me.rbPostscript.Location = New System.Drawing.Point(6, 19)
Me.rbPostscript.Name = "rbPostscript"
Me.rbPostscript.Size = New System.Drawing.Size(71, 17)
Me.rbPostscript.TabIndex = 0
Me.rbPostscript.TabStop = True
Me.rbPostscript.Tag = "PostScript (*.ps)|*.ps"
Me.rbPostscript.Text = "Postscript"
Me.rbPostscript.UseVisualStyleBackColor = True
'
'GroupBox2
'
Me.GroupBox2.Controls.Add(Me.nuDown)
Me.GroupBox2.Controls.Add(Me.Label2)
Me.GroupBox2.Controls.Add(Me.nuStart)
Me.GroupBox2.Controls.Add(Me.Label1)
Me.GroupBox2.Location = New System.Drawing.Point(12, 189)
Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(260, 57)
Me.GroupBox2.TabIndex = 1
Me.GroupBox2.TabStop = False
Me.GroupBox2.Text = "Page Range"
'
'nuDown
'
Me.nuDown.Location = New System.Drawing.Point(168, 24)
Me.nuDown.Minimum = New Decimal(New Integer() {1, 0, 0, 0})
Me.nuDown.Name = "nuDown"
Me.nuDown.Size = New System.Drawing.Size(48, 20)
Me.nuDown.TabIndex = 3
Me.nuDown.Value = New Decimal(New Integer() {1, 0, 0, 0})
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(120, 26)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(43, 13)
Me.Label2.TabIndex = 2
Me.Label2.Text = "to page"
'
'nuStart
'
Me.nuStart.Location = New System.Drawing.Point(65, 24)
Me.nuStart.Minimum = New Decimal(New Integer() {1, 0, 0, 0})
Me.nuStart.Name = "nuStart"
Me.nuStart.Size = New System.Drawing.Size(48, 20)
Me.nuStart.TabIndex = 1
Me.nuStart.Value = New Decimal(New Integer() {1, 0, 0, 0})
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(6, 26)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(57, 13)
Me.Label1.TabIndex = 0
Me.Label1.Text = "From page"
'
'btOK
'
Me.btOK.Location = New System.Drawing.Point(197, 253)
Me.btOK.Name = "btOK"
Me.btOK.Size = New System.Drawing.Size(75, 23)
Me.btOK.TabIndex = 2
Me.btOK.Text = "OK"
Me.btOK.UseVisualStyleBackColor = True
'
'btCancel
'
Me.btCancel.Location = New System.Drawing.Point(116, 253)
Me.btCancel.Name = "btCancel"
Me.btCancel.Size = New System.Drawing.Size(75, 23)
Me.btCancel.TabIndex = 3
Me.btCancel.Text = "Cancel"
Me.btCancel.UseVisualStyleBackColor = True
'
'GroupBox3
'
Me.GroupBox3.Controls.Add(Me.Label4)
Me.GroupBox3.Controls.Add(Me.Label3)
Me.GroupBox3.Controls.Add(Me.nuDPI)
Me.GroupBox3.Location = New System.Drawing.Point(12, 132)
Me.GroupBox3.Name = "GroupBox3"
Me.GroupBox3.Size = New System.Drawing.Size(260, 53)
Me.GroupBox3.TabIndex = 4
Me.GroupBox3.TabStop = False
Me.GroupBox3.Text = "Image Options"
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(129, 24)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(25, 13)
Me.Label4.TabIndex = 2
Me.Label4.Text = "DPI"
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(6, 24)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(60, 13)
Me.Label3.TabIndex = 1
Me.Label3.Text = "Resolution:"
'
'nuDPI
'
Me.nuDPI.Location = New System.Drawing.Point(66, 22)
Me.nuDPI.Maximum = New Decimal(New Integer() {1200, 0, 0, 0})
Me.nuDPI.Minimum = New Decimal(New Integer() {72, 0, 0, 0})
Me.nuDPI.Name = "nuDPI"
Me.nuDPI.Size = New System.Drawing.Size(58, 20)
Me.nuDPI.TabIndex = 0
Me.nuDPI.Value = New Decimal(New Integer() {72, 0, 0, 0})
'
'ExportOptions
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(284, 282)
Me.Controls.Add(Me.GroupBox3)
Me.Controls.Add(Me.btCancel)
Me.Controls.Add(Me.btOK)
Me.Controls.Add(Me.GroupBox2)
Me.Controls.Add(Me.GroupBox1)
Me.Name = "ExportOptions"
Me.Text = "Export PDF Options"
Me.GroupBox1.ResumeLayout(False)
Me.GroupBox1.PerformLayout()
Me.GroupBox2.ResumeLayout(False)
Me.GroupBox2.PerformLayout()
CType(Me.nuDown, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.nuStart, System.ComponentModel.ISupportInitialize).EndInit()
Me.GroupBox3.ResumeLayout(False)
Me.GroupBox3.PerformLayout()
CType(Me.nuDPI, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents rbJpeg As System.Windows.Forms.RadioButton
Friend WithEvents rbText As System.Windows.Forms.RadioButton
Friend WithEvents rbHtml As System.Windows.Forms.RadioButton
Friend WithEvents rbPostscript As System.Windows.Forms.RadioButton
Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
Friend WithEvents nuDown As System.Windows.Forms.NumericUpDown
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents nuStart As System.Windows.Forms.NumericUpDown
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents btOK As System.Windows.Forms.Button
Friend WithEvents btCancel As System.Windows.Forms.Button
Friend WithEvents SaveFileDialog1 As System.Windows.Forms.SaveFileDialog
Friend WithEvents rbTIFF As System.Windows.Forms.RadioButton
Friend WithEvents rbPNG As System.Windows.Forms.RadioButton
Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents nuDPI As System.Windows.Forms.NumericUpDown
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents rbHtmlImage As System.Windows.Forms.RadioButton
End Class

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="SaveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,158 @@
Imports System.Text.RegularExpressions
Public Class ExportOptions
Dim mpdfDoc As PDFLibNet.PDFWrapper
Dim mPdfFileName As String
Dim mFilter As String = ""
Dim mPassword As String = ""
Const BW_TIFF_G4 As String = "tiffg4"
Const BW_TIFF_LZW As String = "tifflzw"
Const GRAY_TIFF_NC As String = "tiffgray"
Const GRAY_PNG = "pnggray"
Const GRAY_JPG = "jpeggray"
Const COLOR_TIFF_RGB As String = "tiff24nc"
Const COLOR_TIFF_CMYK As String = "tiff32nc"
Const COLOR_TIFF_CMYK_SEP As String = "tiffsep"
Const COLOR_PNG_RGB As String = "png16m"
Const COLOR_JPEG = "jpeg"
Public Sub New(ByVal pdfFileName As String, ByVal pdfDoc As PDFLibNet.PDFWrapper, Optional ByVal password As String = "")
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
mPdfFileName = pdfFileName
mpdfDoc = pdfDoc
mPassword = password
nuStart.Maximum = mpdfDoc.PageCount
nuStart.Value = 1
nuDown.Maximum = mpdfDoc.PageCount
nuDown.Value = mpdfDoc.PageCount
nuDPI.Value = 150
SaveFileDialog1.Filter = rbPostscript.Tag
End Sub
Private Sub btOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btOK.Click
If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
Windows.Forms.Cursor.Current = Windows.Forms.Cursors.WaitCursor
Dim filename As String = SaveFileDialog1.FileName
If filename.EndsWith(".ps") Then
mpdfDoc.PrintToFile(filename, nuStart.Value, nuDown.Value)
ElseIf filename.EndsWith(".jpg") Then
ConvertPDF.PDFConvert.ConvertPdfToGraphic(mPdfFileName, SaveFileDialog1.FileName, COLOR_JPEG, nuDPI.Value, nuStart.Value, nuDown.Value, False, mPassword)
ElseIf filename.EndsWith(".tif") Then
Dim returnFileName As String
returnFileName = ConvertPDF.PDFConvert.ConvertPdfToGraphic(mPdfFileName, SaveFileDialog1.FileName, COLOR_TIFF_RGB, nuDPI.Value, nuStart.Value, nuDown.Value, False, mPassword)
Try
ImageUtil.CompressTiff(returnFileName)
Catch
MsgBox("An error occurred while applying LZW compression to the TIFF file. The TIFF file has been saved in an uncompressed format instead.", MsgBoxStyle.OkOnly, "TIFF Compression Error")
End Try
ElseIf filename.EndsWith(".png") Then
ConvertPDF.PDFConvert.ConvertPdfToGraphic(mPdfFileName, SaveFileDialog1.FileName, COLOR_PNG_RGB, nuDPI.Value, nuStart.Value, nuDown.Value, False, mPassword)
ElseIf filename.EndsWith(".txt") Then
mpdfDoc.ExportText(filename, nuStart.Value, nuDown.Value, True, True)
ElseIf filename.EndsWith(".html") And rbHtml.Checked Then
mpdfDoc.ExportHtml(filename, nuStart.Value, nuDown.Value, True, True, False)
ElseIf filename.EndsWith(".html") And rbHtmlImage.Checked Then
ExportHTMLImages(filename)
End If
Windows.Forms.Cursor.Current = Windows.Forms.Cursors.Default
End If
Me.Hide()
End Sub
Private Sub nuStart_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles nuStart.ValueChanged
If nuStart.Value > nuDown.Value Then
nuStart.Value = nuDown.Value
End If
End Sub
Private Sub nuDown_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles nuDown.ValueChanged
If nuDown.Value < nuStart.Value Then
nuDown.Value = nuStart.Value
End If
End Sub
Private Sub CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rbHtml.CheckedChanged, rbJpeg.CheckedChanged, rbPostscript.CheckedChanged, rbText.CheckedChanged, rbPNG.CheckedChanged, rbTIFF.CheckedChanged, rbHtmlImage.CheckedChanged
If rbHtml.Checked Then
SaveFileDialog1.Filter = rbHtml.Tag
GroupBox3.Enabled = False
ElseIf rbHtmlImage.Checked Then
SaveFileDialog1.Filter = rbHtmlImage.Tag
GroupBox3.Enabled = True
ElseIf rbJpeg.Checked Then
SaveFileDialog1.Filter = rbJpeg.Tag
GroupBox3.Enabled = True
ElseIf rbPostscript.Checked Then
SaveFileDialog1.Filter = rbPostscript.Tag
GroupBox3.Enabled = False
ElseIf rbText.Checked Then
SaveFileDialog1.Filter = rbText.Tag
GroupBox3.Enabled = False
ElseIf rbPNG.Checked Then
SaveFileDialog1.Filter = rbPNG.Tag
GroupBox3.Enabled = True
ElseIf rbTIFF.Checked Then
SaveFileDialog1.Filter = rbTIFF.Tag
GroupBox3.Enabled = True
End If
End Sub
Private Sub btCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btCancel.Click
Me.Hide()
End Sub
Private Sub ExportHTMLImages(ByVal fileName As String)
Dim folderPath As String = System.Text.RegularExpressions.Regex.Replace(fileName, "(^.+\\).+$", "$1")
Dim contentFolder As String = folderPath & "content"
Dim imagesFolder As String = contentFolder & "\images"
Dim topFrame As String = My.Resources.TopHtml
topFrame = Regex.Replace(topFrame, "\{DocumentName\}", "<center><h2>" & Regex.Replace(mPdfFileName, "^.+\\", "") & "</h2></center>")
Dim sideFrame As String = My.Resources.BookmarkHtml
'Possible to allow some export from GhostScript renderer
sideFrame = Regex.Replace(sideFrame, "\{Body\}", AFPDFLibUtil.BuildHTMLBookmarks(mpdfDoc))
Dim pageFrame As String = My.Resources.PageHtml
Dim mainPage As String = My.Resources.FrameHtml
Dim pageSize As String = My.Resources.PagesizeHtml
Dim di As System.IO.DirectoryInfo
di = New System.IO.DirectoryInfo(contentFolder)
If (Not di.Exists) Then
di.Create()
End If
di = New System.IO.DirectoryInfo(imagesFolder)
If (Not di.Exists) Then
di.Create()
End If
Dim sw As New IO.StreamWriter(fileName, False)
sw.Write(mainPage)
sw.Close()
Dim sw1 As New IO.StreamWriter(contentFolder & "\top.html", False)
sw1.Write(topFrame)
sw1.Close()
Dim sw2 As New IO.StreamWriter(contentFolder & "\bookmark.html", False)
sw2.Write(sideFrame)
sw2.Close()
Dim sw3 As New IO.StreamWriter(contentFolder & "\page.html", False)
sw3.Write(pageFrame)
sw3.Close()
Dim sw4 As New IO.StreamWriter(contentFolder & "\pagesize.html", False)
sw4.Write(pageSize)
sw4.Close()
ConvertPDF.PDFConvert.ConvertPdfToGraphic(mPdfFileName, imagesFolder & "\page.png", COLOR_PNG_RGB, nuDPI.Value, nuStart.Value, nuDown.Value, False, mPassword)
End Sub
End Class

View File

@@ -0,0 +1,935 @@
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Runtime.InteropServices
Imports System.Collections
Imports System.IO
Imports System.Drawing
Imports System.Windows.Forms
Namespace ConvertPDF
''' <summary>
''' Create by : TaGoH
''' URL of the last version: http://www.codeproject.com/KB/cs/GhostScriptUseWithCSharp.aspx
''' Description:
''' Class to convert a pdf to an image using GhostScript DLL
''' A big Credit for this code go to:Rangel Avulso
''' I mainly create a better interface and refactor it to made it ready to use!
''' </summary>
Public Class PDFConvert
#Region "Static"
''' <summary>Use to check for default transformation</summary>
Private Shared useSimpleAnsiConversion As Boolean = True
''' <summary>Thanks to tchu_2000 to remind that u should never hardcode strings! :)</summary>
Private Const GS_OutputFileFormat As String = "-sOutputFile={0}"
Private Const GS_DeviceFormat As String = "-sDEVICE={0}"
Private Const GS_FirstParameter As String = "pdf2img"
Private Const GS_ResolutionXFormat As String = "-r{0}"
Private Const GS_ResolutionXYFormat As String = "-r{0}x{1}"
Private Const GS_GraphicsAlphaBits As String = "-dGraphicsAlphaBits={0}"
Private Const GS_TextAlphaBits As String = "-dTextAlphaBits={0}"
Private Const GS_FirstPageFormat As String = "-dFirstPage={0}"
Private Const GS_LastPageFormat As String = "-dLastPage={0}"
Private Const GS_FitPage As String = "-dPDFFitPage"
Private Const GS_PageSizeFormat As String = "-g{0}x{1}"
Private Const GS_DefaultPaperSize As String = "-sPAPERSIZE={0}"
Private Const GS_JpegQualityFormat As String = "-dJPEGQ={0}"
Private Const GS_RenderingThreads As String = "-dNumRenderingThreads={0}"
Private Const GS_Fixed1stParameter As String = "-dNOPAUSE"
Private Const GS_Fixed2ndParameter As String = "-dBATCH"
Private Const GS_Fixed3rdParameter As String = "-dSAFER"
Private Const GS_FixedMedia As String = "-dFIXEDMEDIA"
Private Const GS_QuiteOperation As String = "-q"
Private Const GS_StandardOutputDevice As String = "-"
Private Const GS_MultiplePageCharacter As String = "%"
Private Const GS_MaxBitmap As String = "-dMaxBitmap={0}"
Private Const GS_BufferSpace As String = "-dBufferSpace={0}"
Private Const GS_Password As String = "-sPDFPassword={0}"
#End Region
#Region "Windows Import"
''' <summary>Needed to copy memory from one location to another, used to fill the struct</summary>
''' <param name="Destination"></param>
''' <param name="Source"></param>
''' <param name="Length"></param>
<DllImport("kernel32.dll", EntryPoint:="RtlMoveMemory")> _
Private Shared Sub CopyMemory(ByVal Destination As IntPtr, ByVal Source As IntPtr, ByVal Length As UInteger)
End Sub
#End Region
#Region "GhostScript Import"
''' <summary>Create a new instance of Ghostscript. This instance is passed to most other gsapi functions. The caller_handle will be provided to callback functions.
''' At this stage, Ghostscript supports only one instance. </summary>
''' <param name="pinstance"></param>
''' <param name="caller_handle"></param>
''' <returns></returns>
<DllImport("gsdll32.dll", EntryPoint:="gsapi_new_instance")> _
Private Shared Function gsapi_new_instance(ByRef pinstance As IntPtr, ByVal caller_handle As IntPtr) As Integer
End Function
''' <summary>This is the important function that will perform the conversion</summary>
''' <param name="instance"></param>
''' <param name="argc"></param>
''' <param name="argv"></param>
''' <returns></returns>
<DllImport("gsdll32.dll", EntryPoint:="gsapi_init_with_args")> _
Private Shared Function gsapi_init_with_args(ByVal instance As IntPtr, ByVal argc As Integer, ByVal argv As IntPtr) As Integer
End Function
''' <summary>
''' Exit the interpreter. This must be called on shutdown if gsapi_init_with_args() has been called, and just before gsapi_delete_instance().
''' </summary>
''' <param name="instance"></param>
''' <returns></returns>
<DllImport("gsdll32.dll", EntryPoint:="gsapi_exit")> _
Private Shared Function gsapi_exit(ByVal instance As IntPtr) As Integer
End Function
''' <summary>
''' Destroy an instance of Ghostscript. Before you call this, Ghostscript must have finished. If Ghostscript has been initialised, you must call gsapi_exit before gsapi_delete_instance.
''' </summary>
''' <param name="instance"></param>
<DllImport("gsdll32.dll", EntryPoint:="gsapi_delete_instance")> _
Private Shared Sub gsapi_delete_instance(ByVal instance As IntPtr)
End Sub
''' <summary>Get info about the version of Ghostscript i'm using</summary>
''' <param name="pGSRevisionInfo"></param>
''' <param name="intLen"></param>
''' <returns></returns>
<DllImport("gsdll32.dll", EntryPoint:="gsapi_revision")> _
Private Shared Function gsapi_revision(ByRef pGSRevisionInfo As GS_Revision, ByVal intLen As Integer) As Integer
End Function
''' <summary>Use a different I/O</summary>
''' <param name="lngGSInstance"></param>
''' <param name="gsdll_stdin">Function that menage the Standard INPUT</param>
''' <param name="gsdll_stdout">Function that menage the Standard OUTPUT</param>
''' <param name="gsdll_stderr">Function that menage the Standard ERROR output</param>
''' <returns></returns>
<DllImport("gsdll32.dll", EntryPoint:="gsapi_set_stdio")> _
Private Shared Function gsapi_set_stdio(ByVal lngGSInstance As IntPtr, ByVal gsdll_stdin As StdioCallBack, ByVal gsdll_stdout As StdioCallBack, ByVal gsdll_stderr As StdioCallBack) As Integer
End Function
#End Region
#Region "Const"
Const e_Quit As Integer = -101
Const e_NeedInput As Integer = -106
Const BW_TIFF_G4 As String = "tiffg4"
Const BW_TIFF_LZW As String = "tifflzw"
Const GRAY_TIFF_NC As String = "tiffgray"
Const GRAY_PNG = "pnggray"
Const GRAY_JPG = "jpeggray"
Const COLOR_TIFF_RGB As String = "tiff24nc"
Const COLOR_TIFF_CMYK As String = "tiff32nc"
Const COLOR_TIFF_CMYK_SEP As String = "tiffsep"
Const COLOR_PNG_RGB As String = "png16m"
Const COLOR_JPEG = "jpeg"
Const PRINT_DPI As Integer = 300
Const VIEW_DPI As Integer = 200
#End Region
#Region "Variables"
Private _sDeviceFormat As String
Private _sParametersUsed As String
Private _iWidth As Integer
Private _iHeight As Integer
Private _iResolutionX As Integer
Private _iResolutionY As Integer
Private _iJPEGQuality As Integer
Private _iMaxBitmap As Integer = 0
Private _iMaxBuffer As Integer = 0
Private _sUserPassword As String
''' <summary>The first page to convert in image</summary>
Private _iFirstPageToConvert As Integer = -1
''' <summary>The last page to conver in an image</summary>
Private _iLastPageToConvert As Integer = -1
''' <summary>This parameter is used to control subsample antialiasing of graphics</summary>
Private _iGraphicsAlphaBit As Integer = -1
''' <summary>This parameter is used to control subsample antialiasing of text</summary>
Private _iTextAlphaBit As Integer = -1
''' <summary>In how many thread i should perform the conversion</summary>
''' <remarks>This is a Major innovation since 8.63 NEVER use it with previous version!</remarks>
Private _iRenderingThreads As Integer = -1
''' <summary>In how many thread i should perform the conversion</summary>
''' <remarks>This is a Major innovation since 8.63 NEVER use it with previous version!</remarks>
''' <value>Set it to 0 made the program set it to Environment.ProcessorCount HT machine could want to perform a check for this..</value>
Public Property RenderingThreads() As Integer
Get
Return _iRenderingThreads
End Get
Set(ByVal value As Integer)
If value = 0 Then
_iRenderingThreads = Environment.ProcessorCount
Else
_iRenderingThreads = value
End If
End Set
End Property
Private _bFitPage As Boolean
Private _bThrowOnlyException As Boolean = False
Private _bRedirectIO As Boolean = False
Private _bForcePageSize As Boolean = False
''' <summary>The pagesize of the output</summary>
Private _sDefaultPageSize As String
Private _objHandle As IntPtr
''' <summary>If true i will try to output everypage to a different file!</summary>
Private _didOutputToMultipleFile As Boolean = False
Private myProcess As System.Diagnostics.Process
Public output As StringBuilder
'public string output;
'private List<byte> outputBytes;
'public string error;
#End Region
#Region "Proprieties"
''' <summary>
''' What format to use to convert
''' is suggested to use png256 instead of jpeg for document!
''' they are smaller and better suited!
''' </summary>
Public Property OutputFormat() As String
Get
Return _sDeviceFormat
End Get
Set(ByVal value As String)
_sDeviceFormat = value
End Set
End Property
''' <summary>The pagesize of the output</summary>
''' <remarks>Without this parameter the output should be letter, complain to USA for this :) if the document specify a different size it will take precedece over this!</remarks>
Public Property DefaultPageSize() As String
Get
Return _sDefaultPageSize
End Get
Set(ByVal value As String)
_sDefaultPageSize = value
End Set
End Property
''' <summary>If set to true and page default page size will force the rendering in that output format</summary>
Public Property ForcePageSize() As Boolean
Get
Return _bForcePageSize
End Get
Set(ByVal value As Boolean)
_bForcePageSize = value
End Set
End Property
Public Property ParametersUsed() As String
Get
Return _sParametersUsed
End Get
Set(ByVal value As String)
_sParametersUsed = value
End Set
End Property
Public Property Width() As Integer
Get
Return _iWidth
End Get
Set(ByVal value As Integer)
_iWidth = value
End Set
End Property
Public Property Height() As Integer
Get
Return _iHeight
End Get
Set(ByVal value As Integer)
_iHeight = value
End Set
End Property
Public Property MaxBitmap() As Integer
Get
Return _iMaxBitmap
End Get
Set(ByVal value As Integer)
_iMaxBitmap = value
End Set
End Property
Public Property MaxBuffer() As Integer
Get
Return _iMaxBuffer
End Get
Set(ByVal value As Integer)
_iMaxBuffer = value
End Set
End Property
Public Property UserPassword() As String
Get
Return _sUserPassword
End Get
Set(ByVal value As String)
_sUserPassword = value
End Set
End Property
Public Property ResolutionX() As Integer
Get
Return _iResolutionX
End Get
Set(ByVal value As Integer)
_iResolutionX = value
End Set
End Property
Public Property ResolutionY() As Integer
Get
Return _iResolutionY
End Get
Set(ByVal value As Integer)
_iResolutionY = value
End Set
End Property
''' <summary>This parameter is used to control subsample antialiasing of graphics</summary>
''' <value>Value MUST BE below or equal 0 if not set, or 1,2,or 4 NO OTHER VALUES!</value>
Public Property GraphicsAlphaBit() As Integer
Get
Return _iGraphicsAlphaBit
End Get
Set(ByVal value As Integer)
If (value > 4) Or (value = 3) Then
Throw New ArgumentOutOfRangeException("The Graphics Alpha Bit must have a value between 1 2 and 4, or <= 0 if not set")
End If
_iGraphicsAlphaBit = value
End Set
End Property
''' <summary>This parameter is used to control subsample antialiasing of text</summary>
''' <value>Value MUST BE below or equal 0 if not set, or 1,2,or 4 NO OTHER VALUES!</value>
Public Property TextAlphaBit() As Integer
Get
Return _iTextAlphaBit
End Get
Set(ByVal value As Integer)
If (value > 4) Or (value = 3) Then
Throw New ArgumentOutOfRangeException("The Text ALpha Bit must have a value between 1 2 and 4, or <= 0 if not set")
End If
_iTextAlphaBit = value
End Set
End Property
Public Property FitPage() As [Boolean]
Get
Return _bFitPage
End Get
Set(ByVal value As [Boolean])
_bFitPage = value
End Set
End Property
''' <summary>Quality of compression of JPG</summary>
Public Property JPEGQuality() As Integer
Get
Return _iJPEGQuality
End Get
Set(ByVal value As Integer)
_iJPEGQuality = value
End Set
End Property
''' <summary>The first page to convert in image</summary>
Public Property FirstPageToConvert() As Integer
Get
Return _iFirstPageToConvert
End Get
Set(ByVal value As Integer)
_iFirstPageToConvert = value
End Set
End Property
''' <summary>The last page to conver in an image</summary>
Public Property LastPageToConvert() As Integer
Get
Return _iLastPageToConvert
End Get
Set(ByVal value As Integer)
_iLastPageToConvert = value
End Set
End Property
''' <summary>Set to True if u want the program to never display Messagebox
''' but otherwise throw exception</summary>
Public Property ThrowOnlyException() As [Boolean]
Get
Return _bThrowOnlyException
End Get
Set(ByVal value As [Boolean])
_bThrowOnlyException = value
End Set
End Property
''' <summary>If i should redirect the Output of Ghostscript library somewhere</summary>
Public Property RedirectIO() As Boolean
Get
Return _bRedirectIO
End Get
Set(ByVal value As Boolean)
_bRedirectIO = value
End Set
End Property
''' <summary>If true i will try to output everypage to a different file!</summary>
Public Property OutputToMultipleFile() As Boolean
Get
Return _didOutputToMultipleFile
End Get
Set(ByVal value As Boolean)
_didOutputToMultipleFile = value
End Set
End Property
#End Region
#Region "Init"
Public Sub New(ByVal objHandle As IntPtr)
_objHandle = objHandle
End Sub
Public Sub New()
_objHandle = IntPtr.Zero
End Sub
#End Region
#Region "Convert"
''' <summary>Convert a single file!</summary>
''' <param name="inputFile">The file PDf to convert</param>
''' <param name="outputFile">The image file that will be created</param>
''' <remarks>You must pass all the parameter for the conversion
''' as Proprieties of this class</remarks>
''' <returns>True if the conversion succed!</returns>
Public Function Convert(ByVal inputFile As String, ByVal outputFile As String) As Boolean
Return Convert(inputFile, outputFile, _bThrowOnlyException, Nothing)
End Function
''' <summary>Convert a single file!</summary>
''' <param name="inputFile">The file PDf to convert</param>
''' <param name="outputFile">The image file that will be created</param>
''' <param name="parameters">You must pass all the parameter for the conversion here</param>
''' <remarks>Thanks to tchu_2000 for the help!</remarks>
''' <returns>True if the conversion succed!</returns>
Public Function Convert(ByVal inputFile As String, ByVal outputFile As String, ByVal parameters As String) As Boolean
Return Convert(inputFile, outputFile, _bThrowOnlyException, parameters)
End Function
''' <summary>Convert a single file!</summary>
''' <param name="inputFile">The file PDf to convert</param>
''' <param name="outputFile">The image file that will be created</param>
''' <param name="throwException">if the function should throw an exception
''' or display a message box</param>
''' <remarks>You must pass all the parameter for the conversion
''' as Proprieties of this class</remarks>
''' <returns>True if the conversion succed!</returns>
Private Function Convert(ByVal inputFile As String, ByVal outputFile As String, ByVal throwException As Boolean, ByVal options As String) As Boolean
'#Region "Check Input"
'Avoid to work when the file doesn't exist
If String.IsNullOrEmpty(inputFile) Then
If throwException Then
Throw New ArgumentNullException("inputFile")
Else
System.Windows.Forms.MessageBox.Show("The inputfile is missing")
Return False
End If
End If
If Not System.IO.File.Exists(inputFile) Then
If throwException Then
Throw New ArgumentException(String.Format("The file :'{0}' doesn't exist", inputFile), "inputFile")
Else
System.Windows.Forms.MessageBox.Show(String.Format("The file :'{0}' doesn't exist", inputFile))
Return False
End If
End If
If String.IsNullOrEmpty(_sDeviceFormat) Then
If throwException Then
Throw New ArgumentNullException("Device")
Else
System.Windows.Forms.MessageBox.Show("You didn't provide a device for the conversion")
Return False
End If
End If
'be sure that if i specify multiple page outpage i added the % to the filename!
'#End Region
'#Region "Variables"
Dim intReturn As Integer, intCounter As Integer, intElementCount As Integer
'The pointer to the current istance of the dll
Dim intGSInstanceHandle As IntPtr
Dim aAnsiArgs As Object()
Dim aPtrArgs As IntPtr()
Dim aGCHandle As GCHandle()
Dim callerHandle As IntPtr, intptrArgs As IntPtr
Dim gchandleArgs As GCHandle
'#End Region
'Generate the list of the parameters i need to pass to the dll
Dim sArgs As String() = GetGeneratedArgs(inputFile, outputFile, options)
'#Region "Convert Unicode strings to null terminated ANSI byte arrays"
' Convert the Unicode strings to null terminated ANSI byte arrays
' then get pointers to the byte arrays.
intElementCount = sArgs.Length
aAnsiArgs = New Object(intElementCount - 1) {}
aPtrArgs = New IntPtr(intElementCount - 1) {}
aGCHandle = New GCHandle(intElementCount - 1) {}
'Convert the parameters
For intCounter = 0 To intElementCount - 1
aAnsiArgs(intCounter) = StringToAnsiZ(sArgs(intCounter))
aGCHandle(intCounter) = GCHandle.Alloc(aAnsiArgs(intCounter), GCHandleType.Pinned)
aPtrArgs(intCounter) = aGCHandle(intCounter).AddrOfPinnedObject()
Next
gchandleArgs = GCHandle.Alloc(aPtrArgs, GCHandleType.Pinned)
intptrArgs = gchandleArgs.AddrOfPinnedObject()
'#End Region
'#Region "Create a new istance of the library!"
intReturn = -1
Try
intReturn = gsapi_new_instance(intGSInstanceHandle, _objHandle)
'Be sure that we create an istance!
If intReturn < 0 Then
ClearParameters(aGCHandle, gchandleArgs)
If throwException Then
Throw New ApplicationException("I can't create a new istance of Ghostscript please verify no other istance are running!")
Else
System.Windows.Forms.MessageBox.Show("I can't create a new istance of Ghostscript please verify no other istance are running!")
Return False
End If
End If
Catch ex As DllNotFoundException
'in this case the dll we r using isn't the dll we expect
ClearParameters(aGCHandle, gchandleArgs)
If throwException Then
Throw New ApplicationException("The gsdll32.dll wasn't found in default dlls search path" & "or is not in correct version (doesn't expose the required methods). Please download " & "the version 8.64 from the original website")
Else
'Barbara post write much better then me, thanks her for the nice words :P
System.Windows.Forms.MessageBox.Show("The gsdll32.dll wasn't found in default dlls search path" & "or is not in correct version (doesn't expose the required methods). Please download " & "the version 8.64 from the original website")
Return False
End If
End Try
callerHandle = IntPtr.Zero
'remove unwanter handler
'#End Region
'#Region "Capture the I/O"
If (_bRedirectIO) Then
Dim stdinCallback As StdioCallBack
stdinCallback = AddressOf gsdll_stdin
Dim stdoutCallback As StdioCallBack
stdoutCallback = AddressOf gsdll_stdout
Dim stderrCallback As StdioCallBack
stderrCallback = AddressOf gsdll_stderr
intReturn = gsapi_set_stdio(intGSInstanceHandle, stdinCallback, stdoutCallback, stderrCallback)
If output Is Nothing Then
output = New StringBuilder()
Else
output.Remove(0, output.Length)
End If
myProcess = System.Diagnostics.Process.GetCurrentProcess()
AddHandler myProcess.OutputDataReceived, AddressOf SaveOutputToImage
End If
'#End Region
intReturn = -1
'if nothing change it there is an error!
'Ok now is time to call the interesting method
Try
intReturn = gsapi_init_with_args(intGSInstanceHandle, intElementCount, intptrArgs)
Catch ex As Exception
If throwException Then
Throw New ApplicationException(ex.Message, ex)
Else
System.Windows.Forms.MessageBox.Show(ex.Message)
End If
Finally
'No matter what happen i MUST close the istance!
'free all the memory
ClearParameters(aGCHandle, gchandleArgs)
gsapi_exit(intGSInstanceHandle)
'Close the istance
gsapi_delete_instance(intGSInstanceHandle)
'delete it
'In case i was looking for output now stop
If myProcess IsNot Nothing Then
RemoveHandler myProcess.OutputDataReceived, AddressOf SaveOutputToImage
End If
End Try
'Conversion was successfull if return code was 0 or e_Quit
'e_Quit = -101
Return (intReturn = 0) Or (intReturn = e_Quit)
End Function
''' <summary>Remove the memory allocated</summary>
''' <param name="aGCHandle"></param>
''' <param name="gchandleArgs"></param>
Private Sub ClearParameters(ByRef aGCHandle As GCHandle(), ByRef gchandleArgs As GCHandle)
For intCounter As Integer = 0 To aGCHandle.Length - 1
aGCHandle(intCounter).Free()
Next
gchandleArgs.Free()
End Sub
#Region "Test (code not used)"
Private Sub SaveOutputToImage(ByVal sender As Object, ByVal e As System.Diagnostics.DataReceivedEventArgs)
output.Append(e.Data)
End Sub
Public Function Convert(ByVal inputFile As String) As System.Drawing.Image
_bRedirectIO = True
If Convert(inputFile, "%stdout", _bThrowOnlyException) Then
If (output IsNot Nothing) AndAlso (output.Length > 0) Then
'StringReader sr = new StringReader(output.ToString());
'MemoryStream ms = new MemoryStream(UTF8Encoding.Default.GetBytes(output.ToString()));
Dim returnImage As System.Drawing.Image = TryCast(System.Drawing.Image.FromStream(myProcess.StandardOutput.BaseStream).Clone(), System.Drawing.Image)
'ms.Close();
Return returnImage
End If
End If
Return Nothing
End Function
#End Region
#End Region
#Region "Accessory Functions"
''' <summary>This function create the list of parameters to pass to the dll with parameters given directly from the program</summary>
''' <param name="inputFile"></param>
''' <param name="outputFile"></param>
''' <param name="otherParameters">The other parameters i could be interested</param>
''' <remarks>Be very Cautious using this! code provided and modified from tchu_2000</remarks>
''' <returns></returns>
Private Function GetGeneratedArgs(ByVal inputFile As String, ByVal outputFile As String, ByVal otherParameters As String) As String()
If Not String.IsNullOrEmpty(otherParameters) Then
Return GetGeneratedArgs(inputFile, outputFile, otherParameters.Split(New String() {" "}, StringSplitOptions.RemoveEmptyEntries))
Else
Return GetGeneratedArgs(inputFile, outputFile, DirectCast(Nothing, String()))
End If
End Function
''' <summary>This function create the list of parameters to pass to the dll</summary>
''' <param name="inputFile">the file to convert</param>
''' <param name="outputFile">where to write the image</param>
''' <returns>the list of the arguments</returns>
Private Function GetGeneratedArgs(ByVal inputFile As String, ByVal outputFile As String, ByVal presetParameters As String()) As String()
Dim args As String()
Dim lstExtraArgs As New ArrayList()
'ok if i haven't been passed a list of parameters create my own
If (presetParameters Is Nothing) OrElse (presetParameters.Length = 0) Then
'Ok now check argument per argument and compile them
'If i want a jpeg i can set also quality
If _sDeviceFormat = "jpeg" AndAlso _iJPEGQuality > 0 AndAlso _iJPEGQuality < 101 Then
lstExtraArgs.Add(String.Format(GS_JpegQualityFormat, _iJPEGQuality))
End If
'if i provide size it will override the paper size
If _iWidth > 0 AndAlso _iHeight > 0 Then
lstExtraArgs.Add(String.Format(GS_PageSizeFormat, _iWidth, _iHeight))
Else
'otherwise if aviable use the papersize
If Not String.IsNullOrEmpty(_sDefaultPageSize) Then
lstExtraArgs.Add(String.Format(GS_DefaultPaperSize, _sDefaultPageSize))
'It have no meaning to set it if the default page is not set!
If _bForcePageSize Then
lstExtraArgs.Add(GS_FixedMedia)
End If
End If
End If
'not set antialiasing settings
If _iGraphicsAlphaBit > 0 Then
lstExtraArgs.Add(String.Format(GS_GraphicsAlphaBits, _iGraphicsAlphaBit))
End If
If _iTextAlphaBit > 0 Then
lstExtraArgs.Add(String.Format(GS_TextAlphaBits, _iTextAlphaBit))
End If
'Should i try to fit?
If _bFitPage Then
lstExtraArgs.Add(GS_FitPage)
End If
'Should I try to speed up rendering?
If _iMaxBitmap > 0 Then
lstExtraArgs.Add([String].Format(GS_MaxBitmap, _iMaxBitmap))
End If
If _iMaxBuffer > 0 Then
lstExtraArgs.Add([String].Format(GS_BufferSpace, _iMaxBuffer))
End If
'Password
If _sUserPassword <> "" Then
lstExtraArgs.Add([String].Format(GS_Password, _sUserPassword))
End If
'Do i have a forced resolution?
If _iResolutionX > 0 Then
If _iResolutionY > 0 Then
lstExtraArgs.Add([String].Format(GS_ResolutionXYFormat, _iResolutionX, _iResolutionY))
Else
lstExtraArgs.Add([String].Format(GS_ResolutionXFormat, _iResolutionX))
End If
End If
If _iFirstPageToConvert > 0 Then
lstExtraArgs.Add([String].Format(GS_FirstPageFormat, _iFirstPageToConvert))
End If
If _iLastPageToConvert > 0 Then
If (_iFirstPageToConvert > 0) AndAlso (_iFirstPageToConvert > _iLastPageToConvert) Then
Throw New ArgumentOutOfRangeException(String.Format("The 1st page to convert ({0}) can't be after then the last one ({1})", _iFirstPageToConvert, _iLastPageToConvert))
End If
lstExtraArgs.Add([String].Format(GS_LastPageFormat, _iLastPageToConvert))
End If
'Set in how many threads i want to do the work
If _iRenderingThreads > 0 Then
lstExtraArgs.Add([String].Format(GS_RenderingThreads, _iRenderingThreads))
End If
'If i want to redirect write it to the standard output!
If _bRedirectIO Then
'In this case you must also use the -q switch to prevent Ghostscript
'from writing messages to standard output which become
'mixed with the intended output stream.
outputFile = GS_StandardOutputDevice
lstExtraArgs.Add(GS_QuiteOperation)
End If
Dim iFixedCount As Integer = 7
'This are the mandatory options
Dim iExtraArgsCount As Integer = lstExtraArgs.Count
args = New String(iFixedCount + (lstExtraArgs.Count - 1)) {}
args(1) = GS_Fixed1stParameter
'"-dNOPAUSE";//I don't want interruptions
args(2) = GS_Fixed2ndParameter
'"-dBATCH";//stop after
args(3) = GS_Fixed3rdParameter
'"-dSAFER";
args(4) = String.Format(GS_DeviceFormat, _sDeviceFormat)
'what kind of export format i should provide
'For a complete list watch here:
'http://pages.cs.wisc.edu/~ghost/doc/cvs/Devices.htm
'Fill the remaining parameters
For i As Integer = 0 To iExtraArgsCount - 1
args(5 + i) = DirectCast(lstExtraArgs(i), String)
Next
Else
'3 arguments MUST be added 0 (meaningless) and at the end the output and the inputfile
args = New String(presetParameters.Length + 2) {}
'now use the parameters i receive (thanks CrucialBT to point this out!)
For i As Integer = 1 To presetParameters.Length - 1
args(i) = presetParameters(i - 1)
Next
End If
args(0) = GS_FirstParameter
'this parameter have little real use
'Now check if i want to update to 1 file per page i have to be sure do add % to the output filename
If (_didOutputToMultipleFile) AndAlso (Not outputFile.Contains(GS_MultiplePageCharacter)) Then
' Thanks to Spillie to show me the error!
Dim lastDotIndex As Integer = outputFile.LastIndexOf("."c)
If lastDotIndex > 0 Then
outputFile = outputFile.Insert(lastDotIndex, "%d")
End If
End If
'Ok now save them to be shown 4 debug use
_sParametersUsed = String.Empty
'Copy all the args except the 1st that is useless and the last 2
For i As Integer = 1 To args.Length - 3
_sParametersUsed += " " & args(i)
Next
'Fill outputfile and inputfile as last 2 arguments!
args(args.Length - 2) = String.Format(GS_OutputFileFormat, outputFile)
args(args.Length - 1) = String.Format("{0}", inputFile)
_sParametersUsed += (" " & String.Format(GS_OutputFileFormat, String.Format("""{0}""", outputFile)) & " ") + String.Format("""{0}""", inputFile)
Return args
End Function
''' <summary>
''' Convert a Unicode string to a null terminated Ansi string for Ghostscript.
''' The result is stored in a byte array
''' </summary>
''' <param name="str">The parameter i want to convert</param>
''' <returns>the byte array that contain the string</returns>
Private Shared Function StringToAnsiZ(ByVal str As String) As Byte()
' Later you will need to convert
' this byte array to a pointer with
' GCHandle.Alloc(XXXX, GCHandleType.Pinned)
' and GSHandle.AddrOfPinnedObject()
'int intElementCount,intCounter;
'This with Encoding.Default should work also with Chineese Japaneese
'Thanks to tchu_2000 I18N related patch
If str Is Nothing Then
str = [String].Empty
End If
Return Encoding.[Default].GetBytes(str)
End Function
''' <summary>Convert a Pointer to a string to a real string</summary>
''' <param name="strz">the pointer to the string in memory</param>
''' <returns>The string</returns>
Public Shared Function AnsiZtoString(ByVal strz As IntPtr) As String
If strz <> IntPtr.Zero Then
Return Marshal.PtrToStringAnsi(strz)
Else
Return String.Empty
End If
End Function
#End Region
#Region "Menage Standard Input & Standard Output"
Public Function gsdll_stdin(ByVal intGSInstanceHandle As IntPtr, ByVal strz As IntPtr, ByVal intBytes As Integer) As Integer
' This is dumb code that reads one byte at a time
' Ghostscript doesn't mind this, it is just very slow
'If intBytes = 0 Then
' Return 0
'Else
' Dim ich As Integer = Console.Read()
' If ich = -1 Then
' Return 0
' Else
' ' EOF
' Dim bch As Byte = CByte(ich)
' Dim gcByte As GCHandle = GCHandle.Alloc(bch, GCHandleType.Pinned)
' Dim ptrByte As IntPtr = gcByte.AddrOfPinnedObject()
' CopyMemory(strz, ptrByte, 1)
' ptrByte = IntPtr.Zero
' gcByte.Free()
' Return 1
' End If
'End If
End Function
Public Function gsdll_stdout(ByVal intGSInstanceHandle As IntPtr, ByVal strz As IntPtr, ByVal intBytes As Integer) As Integer
If intBytes > 0 Then
'Console.Write(Marshal.PtrToStringAnsi(strz))
End If
Return 0
End Function
Public Function gsdll_stderr(ByVal intGSInstanceHandle As IntPtr, ByVal strz As IntPtr, ByVal intBytes As Integer) As Integer
'return gsdll_stdout(intGSInstanceHandle, strz, intBytes);
'Console.Write(Marshal.PtrToStringAnsi(strz))
Return intBytes
End Function
#End Region
#Region "Menage Revision"
Public Function GetRevision() As GhostScriptRevision
' Check revision number of Ghostscript
Dim intReturn As Integer
Dim udtGSRevInfo As New GS_Revision()
Dim output As GhostScriptRevision
Dim gcRevision As GCHandle
gcRevision = GCHandle.Alloc(udtGSRevInfo, GCHandleType.Pinned)
intReturn = gsapi_revision(udtGSRevInfo, 16)
output.intRevision = udtGSRevInfo.intRevision
output.intRevisionDate = udtGSRevInfo.intRevisionDate
output.ProductInformation = AnsiZtoString(udtGSRevInfo.strProduct)
output.CopyrightInformations = AnsiZtoString(udtGSRevInfo.strCopyright)
gcRevision.Free()
Return output
End Function
#End Region
#Region "Simple Conversion Functions"
Public Shared Function ConvertPdfToGraphic(ByVal inputFileName As String, _
ByVal outputFileName As String, _
ByVal fileFormat As String, _
ByVal DPI As Integer, _
Optional ByVal startPageNumber As Integer = 0, _
Optional ByVal endPageNumber As Integer = 0, _
Optional ByVal ToPrinter As Boolean = False, _
Optional ByVal Password As String = "" _
) As String
ConvertPdfToGraphic = ""
Dim converter As New ConvertPDF.PDFConvert
Dim Converted As Boolean = False
converter.RenderingThreads = Environment.ProcessorCount
If fileFormat.Contains("tif") Then
converter.OutputToMultipleFile = False
Else
converter.OutputToMultipleFile = True
End If
If startPageNumber = 0 Then
converter.FirstPageToConvert = -1
converter.LastPageToConvert = -1
Else
converter.FirstPageToConvert = startPageNumber
converter.LastPageToConvert = endPageNumber
End If
converter.FitPage = False
converter.JPEGQuality = 70
If ToPrinter = True Then 'Turn off anti-aliasing
converter.TextAlphaBit = -1
converter.GraphicsAlphaBit = -1
Else 'Turn on anti-aliasing
converter.TextAlphaBit = 4
converter.GraphicsAlphaBit = 4
End If
converter.ResolutionX = DPI
converter.ResolutionY = DPI
converter.OutputFormat = fileFormat
converter.UserPassword = Password
Dim input As System.IO.FileInfo = New FileInfo(inputFileName)
'If the output file exists already, be sure to add a random name at the end until it is unique
While File.Exists(outputFileName)
Dim suffix As String = System.Text.RegularExpressions.Regex.Replace(outputFileName, "^.+\.(.+$)", "$1")
outputFileName = outputFileName.Replace("." & suffix, "(" & Now.Ticks & ")." & suffix)
End While
Converted = converter.Convert(input.FullName, outputFileName)
If Converted Then
ConvertPdfToGraphic = outputFileName
Else
ConvertPdfToGraphic = ""
End If
End Function
Public Shared Function GetPageFromPDF(ByVal filename As String, ByVal PageNumber As Integer, Optional ByVal DPI As Integer = VIEW_DPI, Optional ByVal Password As String = "", Optional ByVal forPrinting As Boolean = False) As System.Drawing.Image
Dim converter As New ConvertPDF.PDFConvert
Dim Converted As Boolean = False
converter.RenderingThreads = Environment.ProcessorCount
converter.OutputToMultipleFile = False
converter.MaxBitmap = 100000000 '100 MB
converter.MaxBuffer = 200000000 '200 MB
If PageNumber > 0 Then
converter.FirstPageToConvert = PageNumber
converter.LastPageToConvert = PageNumber
Else
GetPageFromPDF = Nothing
Exit Function
End If
converter.FitPage = False
converter.JPEGQuality = 70
converter.UserPassword = Password
If DPI <> VIEW_DPI Then 'Custom resolution
converter.ResolutionX = DPI
converter.ResolutionY = DPI
Else ' Default resolution
converter.ResolutionX = VIEW_DPI
converter.ResolutionY = VIEW_DPI
End If
If forPrinting Then 'Turn off anti-aliasing (crisp edges)
converter.TextAlphaBit = -1
converter.GraphicsAlphaBit = -1
Else 'Turn on anti-aliasing (smooth edges)
converter.TextAlphaBit = 4
converter.GraphicsAlphaBit = 4
End If
converter.OutputFormat = COLOR_PNG_RGB
Dim output As String = System.IO.Path.GetTempPath & Now.Ticks & ".png"
Converted = converter.Convert(filename, output)
If Converted Then
GetPageFromPDF = New Bitmap(output)
ImageUtil.DeleteFile(output)
Else
GetPageFromPDF = Nothing
End If
End Function
#End Region
End Class
''' <summary>Delegate used by Ghostscript to perform I/O operations</summary>
''' <param name="handle"></param>
''' <param name="strptr"></param>
''' <param name="count"></param>
''' <returns></returns>
Public Delegate Function StdioCallBack(ByVal handle As IntPtr, ByVal strptr As IntPtr, ByVal count As Integer) As Integer
''' <summary>This struct is filled with the information of the version of this ghostscript</summary>
''' <remarks>Have the layout defined cuz i will fill it with a kernel copy memory</remarks>
<StructLayout(LayoutKind.Sequential)> _
Structure GS_Revision
Public strProduct As IntPtr
Public strCopyright As IntPtr
Public intRevision As Integer
Public intRevisionDate As Integer
End Structure
Public Structure GhostScriptRevision
Public ProductInformation As String
Public CopyrightInformations As String
Public intRevision As Integer
Public intRevisionDate As Integer
End Structure
End Namespace

View File

@@ -0,0 +1,390 @@
Imports System.Drawing.Imaging
Imports System
Imports System.Drawing
Imports System.Runtime.InteropServices
Imports System.IO
Imports System.Drawing.Drawing2D
Imports System.Text.RegularExpressions
Imports System.Windows.Forms
Public Class ImageUtil
Public Shared Function MakeGrayscale(ByVal original As System.Drawing.Bitmap) As System.Drawing.Bitmap
'create a blank bitmap the same size as original
Dim newBitmap As New System.Drawing.Bitmap(original.Width, original.Height)
'get a graphics object from the new image
Dim g As Graphics = Graphics.FromImage(newBitmap)
'create the grayscale ColorMatrix
Dim colorMatrix As New ColorMatrix(New Single()() {New Single() {0.3, 0.3, 0.3, 0, 0}, New Single() {0.59, 0.59, 0.59, 0, 0}, New Single() {0.11, 0.11, 0.11, 0, 0}, New Single() {0, 0, 0, 1, 0}, New Single() {0, 0, 0, 0, 1}})
'create some image attributes
Dim attributes As New ImageAttributes()
'set the color matrix attribute
attributes.SetColorMatrix(colorMatrix)
'draw the original image on the new image
'using the grayscale color matrix
g.DrawImage(original, New Rectangle(0, 0, original.Width, original.Height), 0, 0, original.Width, original.Height, _
GraphicsUnit.Pixel, attributes)
'dispose the Graphics object
g.Dispose()
Return newBitmap
End Function
Public Shared Function BitmapTo1Bpp(ByVal img As System.Drawing.Bitmap) As System.Drawing.Bitmap
If img.PixelFormat <> PixelFormat.Format32bppPArgb Then
Dim temp As New System.Drawing.Bitmap(img.Width, img.Height, PixelFormat.Format32bppPArgb)
Dim g As Graphics = Graphics.FromImage(temp)
g.DrawImage(img, New Rectangle(0, 0, img.Width, img.Height), 0, 0, img.Width, img.Height, GraphicsUnit.Pixel)
img.Dispose()
g.Dispose()
img = temp
End If
Dim imageTemp As System.Drawing.Image
imageTemp = img
'lock the bits of the original bitmap
Dim bmdo As BitmapData = img.LockBits(New Rectangle(0, 0, img.Width, img.Height), ImageLockMode.ReadOnly, img.PixelFormat)
'and the new 1bpp bitmap
Dim bm As New System.Drawing.Bitmap(imageTemp.Width, imageTemp.Height, PixelFormat.Format1bppIndexed)
Dim bmdn As BitmapData = bm.LockBits(New Rectangle(0, 0, bm.Width, bm.Height), ImageLockMode.ReadWrite, PixelFormat.Format1bppIndexed)
'for diagnostics
Dim dt As DateTime = DateTime.Now
'scan through the pixels Y by X
Dim y As Integer
For y = 0 To img.Height - 1
Dim x As Integer
For x = 0 To img.Width - 1
'generate the address of the colour pixel
Dim index As Integer = y * bmdo.Stride + x * 4
'check its brightness
If Color.FromArgb(Marshal.ReadByte(bmdo.Scan0, index + 2), Marshal.ReadByte(bmdo.Scan0, index + 1), Marshal.ReadByte(bmdo.Scan0, index)).GetBrightness() > 0.5F Then
Dim imgUtil As New ImageUtil
imgUtil.SetIndexedPixel(x, y, bmdn, True) 'set it if its bright.
End If
Next x
Next y
'tidy up
bm.UnlockBits(bmdn)
img.UnlockBits(bmdo)
imageTemp = Nothing
'display the 1bpp image.
Return bm
End Function
Public Shared Sub ScaleImage(ByRef img As Drawing.Image, ByVal scale_factor As Single)
Dim bm_source As New Drawing.Bitmap(img)
Dim bm_dest As New Drawing.Bitmap( _
CInt(bm_source.Width * scale_factor), _
CInt(bm_source.Height * scale_factor))
Dim gr_dest As Graphics = Graphics.FromImage(bm_dest)
gr_dest.DrawImage(bm_source, 0, 0, _
bm_dest.Width + 1, _
bm_dest.Height + 1)
bm_source = Nothing
gr_dest.Dispose()
img = bm_dest
End Sub
Public Shared Sub ScaleImageToPicBox(ByRef oPict As PictureBox, ByRef img As Drawing.Image)
Dim xPercent As Single = oPict.Width / img.Width
Dim yPercent As Single = oPict.Height / img.Height
Dim scalePercent As Single = 0
If xPercent > yPercent Then
scalePercent = yPercent
Else
scalePercent = xPercent
End If
ScaleImage(img, scalePercent)
End Sub
Public Shared Sub RotateImageClockwise(ByRef pPicBox As PictureBox)
pPicBox.Image.RotateFlip(RotateFlipType.Rotate90FlipNone)
FlipDimensions(pPicBox)
RecalcPageLocation(pPicBox)
pPicBox.Refresh()
End Sub
Public Shared Sub RotateImageCounterclockwise(ByRef pPicBox As PictureBox)
pPicBox.Image.RotateFlip(RotateFlipType.Rotate270FlipNone)
FlipDimensions(pPicBox)
RecalcPageLocation(pPicBox)
pPicBox.Refresh()
End Sub
Public Shared Sub FlipDimensions(ByRef pPicbox As PictureBox)
Dim height As Integer = pPicbox.Height
Dim width As Integer = pPicbox.Width
pPicbox.Height = width
pPicbox.Width = height
End Sub
Public Shared Sub ApplyRotation(ByRef img As Drawing.Image, ByVal numberOfRotations As Integer)
If numberOfRotations < 0 Then
For i As Integer = 1 To Math.Abs(numberOfRotations)
img.RotateFlip(RotateFlipType.Rotate270FlipNone)
Next
End If
If numberOfRotations > 0 Then
For i As Integer = 1 To numberOfRotations
img.RotateFlip(RotateFlipType.Rotate90FlipNone)
Next
End If
End Sub
Public Shared Sub PictureBoxZoomActual(ByRef pPicBox As PictureBox)
If Not Nothing Is pPicBox And Not Nothing Is pPicBox.Image Then
pPicBox.Width = pPicBox.Image.Width
pPicBox.Height = pPicBox.Image.Height
End If
End Sub
Public Shared Sub PictureBoxZoomPageWidth(ByRef pPicBox As PictureBox)
If Not Nothing Is pPicBox And Not Nothing Is pPicBox.Parent Then
pPicBox.Width = pPicBox.Parent.ClientSize.Width - 18
Dim ScaleAmount As Double = (pPicBox.Width / pPicBox.Image.Width)
pPicBox.Height = CInt(pPicBox.Image.Height * ScaleAmount)
End If
End Sub
Public Shared Sub PictureBoxZoomFit(ByRef pPicBox As PictureBox)
If Not Nothing Is pPicBox And Not Nothing Is pPicBox.Parent Then
PictureBoxCenter(pPicBox, (pPicBox.Parent.ClientSize.Width - 7), (pPicBox.Parent.ClientSize.Height - 7))
pPicBox.Location = New Point(0, 0)
End If
End Sub
Public Shared Sub PictureBoxZoomIn(ByRef pPicBox As PictureBox)
If Not Nothing Is pPicBox And Not Nothing Is pPicBox.Parent Then
PictureBoxCenter(pPicBox, (pPicBox.Width * 1.25), (pPicBox.Height * 1.25))
End If
End Sub
Public Shared Sub PictureBoxZoomOut(ByRef pPicBox As PictureBox)
If Not Nothing Is pPicBox Then
PictureBoxCenter(pPicBox, (pPicBox.Width / 1.25), (pPicBox.Height / 1.25))
End If
End Sub
Public Shared Sub PictureBoxCenter(ByRef oPictureBox As PictureBox, ByVal psWidth As Integer, ByVal psHeight As Integer)
oPictureBox.Width = psWidth
oPictureBox.Height = psHeight
RecalcPageLocation(oPictureBox)
End Sub
Public Shared Sub RecalcPageLocation(ByRef oPictureBox As PictureBox)
Dim PageSize As New Size(oPictureBox.Size)
Dim ClientBounds As New Size(oPictureBox.Parent.ClientSize)
Dim PageLocation As New Point(oPictureBox.Location)
Dim HorizontalScrollPosition As Integer = CType(oPictureBox.Parent, Panel).HorizontalScroll.Value
Dim VerticalScrollPosition As Integer = CType(oPictureBox.Parent, Panel).VerticalScroll.Value
Dim LeftMargin As Integer = oPictureBox.Parent.Margin.Left
Dim TopMargin As Integer = oPictureBox.Parent.Margin.Top
If PageSize.Width < ClientBounds.Width AndAlso PageSize.Height > ClientBounds.Height Then
'Center vertically
PageLocation = New Point((ClientBounds.Width - PageSize.Width) / 2 + LeftMargin, TopMargin - VerticalScrollPosition)
ElseIf PageSize.Width > ClientBounds.Width AndAlso PageSize.Height < ClientBounds.Height Then
'Center horizontally
PageLocation = New Point(LeftMargin - HorizontalScrollPosition, (ClientBounds.Height - PageSize.Height) / 2 + TopMargin)
ElseIf PageSize.Width < ClientBounds.Width AndAlso PageSize.Height < ClientBounds.Height Then
'center both
PageLocation = New Point((ClientBounds.Width - PageSize.Width) / 2 + LeftMargin, (ClientBounds.Height - PageSize.Height) / 2 + TopMargin)
Else
PageLocation = New Point(LeftMargin - HorizontalScrollPosition, TopMargin - VerticalScrollPosition)
End If
oPictureBox.Location = PageLocation
oPictureBox.Bounds = New Rectangle(PageLocation, PageSize)
End Sub
Public Shared Sub PictureBoxZoomFitMany(ByRef pPicBox As PictureBox)
If Not Nothing Is pPicBox.Parent Then
Dim Height As Integer = pPicBox.Parent.ClientSize.Height - 14
Dim Width As Integer = pPicBox.Parent.ClientSize.Width - 14
Dim Location As New Point(0, 0)
For Each itemControl As Control In pPicBox.Parent.Controls
If TypeOf itemControl Is PictureBox Then
itemControl.Height = Height
itemControl.Width = Width
itemControl.Location = Location
End If
Next
End If
End Sub
Public Shared Function GenerateThumbnail(ByVal original As System.Drawing.Image, ByVal percentage As Integer) As System.Drawing.Image
If percentage < 1 Then
Throw New Exception("Thumbnail size must be aat least 1% of the original size")
End If
Dim tn As New System.Drawing.Bitmap(CInt(original.Width * 0.01F * percentage), CInt(original.Height * 0.01F * percentage))
Dim g As Graphics = Graphics.FromImage(tn)
g.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBilinear
g.DrawImage(original, New Rectangle(0, 0, tn.Width, tn.Height), 0, 0, original.Width, original.Height, GraphicsUnit.Pixel)
g.Dispose()
Return CType(tn, System.Drawing.Image)
End Function
Public Shared Function SaveImageToTiff(ByVal img As System.Drawing.Image) As String
Dim sTemp As String = My.Computer.FileSystem.SpecialDirectories.Temp & "\DDI_"
Dim sTStamp As String = Format(Now, "yyyyMMddhhmmssfff")
Dim FileName As String = sTemp & sTStamp & ".tif"
img.Save(FileName, ImageFormat.Tiff)
Return FileName
End Function
Public Shared Function GetFrameFromTiff(ByVal Filename As String, ByVal FrameNumber As Integer) As System.Drawing.Image
Dim fs As FileStream = File.Open(Filename, FileMode.Open, FileAccess.Read)
Dim bm As System.Drawing.Bitmap = CType(System.Drawing.Bitmap.FromStream(fs), System.Drawing.Bitmap)
bm.SelectActiveFrame(FrameDimension.Page, FrameNumber)
Dim temp As New System.Drawing.Bitmap(bm.Width, bm.Height)
Dim g As Graphics = Graphics.FromImage(temp)
g.InterpolationMode = InterpolationMode.NearestNeighbor
g.DrawImage(bm, 0, 0, bm.Width, bm.Height)
g.Dispose()
GetFrameFromTiff = temp
fs.Close()
End Function
Public Shared Function GetImagePageFromFileForPrint(ByVal sFileName As String, ByVal iPageNumber As Integer, Optional ByVal DPI As Integer = 300, Optional ByVal password As String = "") As System.Drawing.Image
GetImagePageFromFileForPrint = Nothing
If ImageUtil.IsPDF(sFileName) Then 'get image of page from file for printing
GetImagePageFromFileForPrint = ConvertPDF.PDFConvert.GetPageFromPDF(sFileName, iPageNumber, DPI, password, True)
ElseIf ImageUtil.IsTiff(sFileName) Then
GetImagePageFromFileForPrint = ImageUtil.GetFrameFromTiff(sFileName, iPageNumber - 1)
End If
End Function
Public Shared Function GetImageFrameCount(ByVal sFileName As String, Optional ByVal userPassword As String = "") As Integer
If ImageUtil.IsPDF(sFileName) Then
GetImageFrameCount = iTextSharpUtil.GetPDFPageCount(sFileName, userPassword)
ElseIf ImageUtil.IsTiff(sFileName) Then
GetImageFrameCount = GetTiffFrameCount(sFileName)
End If
End Function
Public Shared Function GetTiffFrameCount(ByVal FileName As String) As Integer
Dim bm As New System.Drawing.Bitmap(FileName)
GetTiffFrameCount = bm.GetFrameCount(FrameDimension.Page)
bm.Dispose()
End Function
Public Shared Sub DeleteFile(ByVal filename As String)
Try
System.IO.File.Delete(filename)
Catch ex As Exception
End Try
End Sub
Public Shared Function IsTiff(ByVal filename As String) As Boolean
If Nothing Is filename Then Return False
Return Regex.IsMatch(filename, "\.tiff*$", RegexOptions.IgnoreCase)
End Function
Public Shared Function IsPDF(ByVal filename As String) As Boolean
If Nothing Is filename Then Return False
Return Regex.IsMatch(filename, "\.pdf$", RegexOptions.IgnoreCase)
End Function
Public Shared Function CropBitmap(ByRef bmp As System.Drawing.Bitmap, ByVal cropX As Integer, ByVal cropY As Integer, ByVal cropWidth As Integer, ByVal cropHeight As Integer) As System.Drawing.Bitmap
Dim rect As New Rectangle(cropX, cropY, cropWidth, cropHeight)
Dim cropped As System.Drawing.Bitmap = bmp.Clone(rect, bmp.PixelFormat)
Return cropped
End Function
Public Shared Sub CompressTiff(ByVal Filename As String)
Dim myBitmap As System.Drawing.Bitmap
Dim myImageCodecInfo As ImageCodecInfo
Dim myEncoder As Encoder
Dim myEncoderParameter1 As EncoderParameter
Dim myEncoderParameter2 As EncoderParameter
Dim myEncoderParameters As EncoderParameters
' Create a Bitmap object based on a BMP file.
myBitmap = New System.Drawing.Bitmap(Filename)
' Get an ImageCodecInfo object that represents the TIFF codec.
myImageCodecInfo = GetEncoderInfo("image/tiff")
' Create an Encoder object based on the GUID
' for the Compression parameter category.
myEncoder = Encoder.Compression
' Create an EncoderParameters object.
' An EncoderParameters object has an array of EncoderParameter
' objects. In this case, there is only one
' EncoderParameter object in the array.
myEncoderParameters = New EncoderParameters(2)
' Save the bitmap as a TIFF file with LZW compression.
myEncoderParameter1 = New EncoderParameter(myEncoder, Fix(EncoderValue.CompressionLZW))
myEncoderParameter2 = New EncoderParameter(Encoder.SaveFlag, CLng(EncoderValue.MultiFrame))
myEncoderParameters.Param(0) = myEncoderParameter1
myEncoderParameters.Param(1) = myEncoderParameter2
Dim outputfilename As String = Filename.Replace(".tif", Now.Ticks & ".tif")
myBitmap.Save(outputfilename, myImageCodecInfo, myEncoderParameters)
Dim FrameCount As Integer = myBitmap.GetFrameCount(FrameDimension.Page)
If FrameCount > 1 Then
For iFrame As Integer = 1 To FrameCount - 1
myBitmap.SelectActiveFrame(FrameDimension.Page, iFrame)
myEncoderParameters.Param(0) = New EncoderParameter(Encoder.SaveFlag, CLng(EncoderValue.FrameDimensionPage))
myBitmap.SaveAdd(myBitmap, myEncoderParameters)
Next
End If
myEncoderParameters.Param(0) = New EncoderParameter(Encoder.SaveFlag, CLng(EncoderValue.Flush))
myBitmap.SaveAdd(myEncoderParameters)
myBitmap.Dispose()
While File.Exists(Filename)
Try
File.Delete(Filename)
Catch
End Try
End While
File.Move(outputfilename, Filename)
End Sub
'Needed subroutine for 1bit conversion
Protected Sub SetIndexedPixel(ByVal x As Integer, ByVal y As Integer, ByVal bmd As BitmapData, ByVal pixel As Boolean)
Dim index As Integer = y * bmd.Stride + (x >> 3)
Dim p As Byte = Marshal.ReadByte(bmd.Scan0, index)
Dim mask As Byte = &H80 >> (x And &H7)
If pixel Then
p = p Or mask
Else
p = p And CByte(mask ^ &HFF)
End If
Marshal.WriteByte(bmd.Scan0, index, p)
End Sub
Private Shared Function GetEncoderInfo(ByVal mimeType As String) As ImageCodecInfo
Dim j As Integer
Dim encoders() As ImageCodecInfo
encoders = ImageCodecInfo.GetImageEncoders()
j = 0
While j < encoders.Length
If encoders(j).MimeType = mimeType Then
Return encoders(j)
End If
j += 1
End While
Return Nothing
End Function
End Class

View File

@@ -0,0 +1,69 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class ImportProgress
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.ProgressBar1 = New System.Windows.Forms.ProgressBar
Me.Label1 = New System.Windows.Forms.Label
Me.SuspendLayout()
'
'ProgressBar1
'
Me.ProgressBar1.Location = New System.Drawing.Point(12, 48)
Me.ProgressBar1.Name = "ProgressBar1"
Me.ProgressBar1.Size = New System.Drawing.Size(288, 23)
Me.ProgressBar1.TabIndex = 0
'
'Label1
'
Me.Label1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Label1.Location = New System.Drawing.Point(12, 18)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(288, 18)
Me.Label1.TabIndex = 1
Me.Label1.Text = "Processing Image Files"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'ImportProgress
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(312, 83)
Me.ControlBox = False
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.ProgressBar1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "ImportProgress"
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "Import Progress"
Me.ResumeLayout(False)
End Sub
Friend WithEvents ProgressBar1 As System.Windows.Forms.ProgressBar
Friend WithEvents Label1 As System.Windows.Forms.Label
End Class

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,15 @@
Imports System.Windows.Forms
Public Class ImportProgress
Private Sub ImportProgress_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Public Sub UpdateProgress(ByVal message As String, ByVal progress As Integer)
Label1.Text = message
ProgressBar1.Increment(progress)
Label1.Update()
End Sub
End Class

View File

@@ -0,0 +1,13 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:2.0.50727.3074
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>false</MySubMain>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<ApplicationType>1</ApplicationType>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>

View File

@@ -0,0 +1,35 @@
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("PDFViewer")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("PDFViewer")>
<Assembly: AssemblyCopyright("Copyright © 2009")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("2c94eaa7-7e88-40ea-bab7-e10979b1845f")>
' Version information for an assembly consists of the following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@@ -0,0 +1,155 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:2.0.50727.3074
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Imports System
Namespace My.Resources
'This class was auto-generated by the StronglyTypedResourceBuilder
'class via a tool like ResGen or Visual Studio.
'To add or remove a member, edit your .ResX file then rerun ResGen
'with the /str option, or rebuild your VS project.
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("PDFView.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Overrides the current thread's CurrentUICulture property for all
''' resource lookups using this strongly typed resource class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set
resourceCulture = value
End Set
End Property
'''<summary>
''' Looks up a localized string similar to &lt;HTML&gt;
'''&lt;HEAD&gt;
'''&lt;TITLE&gt;PageIndex&lt;/TITLE&gt;
'''&lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&gt;
'''function changeImage(filename)
'''{
''' parent.pageviewer.document.images[&apos;mainimage&apos;].src = filename;
'''}
'''&lt;/script&gt;
'''&lt;/HEAD&gt;
'''&lt;BODY bgcolor=&quot;#DDDDDD&quot;&gt;{Body}&lt;/BODY&gt;
'''&lt;/HTML&gt;.
'''</summary>
Friend ReadOnly Property BookmarkHtml() As String
Get
Return ResourceManager.GetString("BookmarkHtml", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to &lt;HTML&gt;
'''&lt;HEAD&gt;
'''&lt;TITLE&gt;PDF to Image Html&lt;/TITLE&gt;
'''&lt;/HEAD&gt;
'''&lt;FRAMESET ROWS=&quot;50,*&quot; FRAMEBORDER=0 BORDER=0 &gt;
''' &lt;FRAME NAME=&quot;top&quot; SRC=&quot;content/top.html&quot; MARGINHEIGHT=0 MARGINWIDTH=0 NORESIZE&gt;
''' &lt;FRAMESET COLS=&quot;20%,80%&quot; FRAMEBORDER=0 BORDER=0&gt;
''' &lt;FRAME NAME=&quot;left&quot; SRC=&quot;content/bookmark.html&quot; MARGINHEIGHT=0 MARGINWIDTH=0 SCROLLING=AUTO NORESIZE&gt;
''' &lt;FRAMESET ROWS=&quot;*,25&quot; FRAMEBORDER=0 BORDER=0 &gt;
''' &lt;FRAME NAME=&quot;pa [rest of string was truncated]&quot;;.
'''</summary>
Friend ReadOnly Property FrameHtml() As String
Get
Return ResourceManager.GetString("FrameHtml", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to &lt;HTML&gt;
'''&lt;HEAD&gt;
'''&lt;TITLE&gt;PageViewer&lt;/TITLE&gt;
'''&lt;/HEAD&gt;
'''&lt;BODY bgcolor=&quot;#999999&quot;&gt;&lt;center&gt;&lt;img id=&quot;mainimage&quot; src=&quot;images/page1.png&quot; width=&quot;100%&quot;&gt;&lt;/center&gt;&lt;/BODY&gt;
'''&lt;/HTML&gt;.
'''</summary>
Friend ReadOnly Property PageHtml() As String
Get
Return ResourceManager.GetString("PageHtml", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to &lt;HTML&gt;
'''&lt;HEAD&gt;
'''&lt;TITLE&gt;PageSize&lt;/TITLE&gt;
'''&lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&gt;
'''function fitScreen()
'''{
'''parent.pageviewer.document.images[&apos;mainimage&apos;].style.height = &apos;100%&apos;;
'''parent.pageviewer.document.images[&apos;mainimage&apos;].style.width = &apos;auto&apos;;
'''}
'''function fitWidth()
'''{
'''parent.pageviewer.document.images[&apos;mainimage&apos;].style.height = &apos;auto&apos;;
'''parent.pageviewer.document.images[&apos;mainimage&apos;].style.width = &apos;100%&apos;;
'''}
'''function fitActual()
'''{
'''parent.pageviewer.document.images[&apos;mainimage&apos;].style.height = &apos;auto&apos;;
'''parent [rest of string was truncated]&quot;;.
'''</summary>
Friend ReadOnly Property PagesizeHtml() As String
Get
Return ResourceManager.GetString("PagesizeHtml", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to &lt;HTML&gt;
'''&lt;HEAD&gt;
'''&lt;TITLE&gt;DocumentName&lt;/TITLE&gt;
'''&lt;/HEAD&gt;
'''&lt;BODY bgcolor=&quot;#BBBBBB&quot;&gt;{DocumentName}&lt;/BODY&gt;
'''&lt;/HTML&gt;.
'''</summary>
Friend ReadOnly Property TopHtml() As String
Get
Return ResourceManager.GetString("TopHtml", resourceCulture)
End Get
End Property
End Module
End Namespace

View File

@@ -0,0 +1,196 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="BookmarkHtml" xml:space="preserve">
<value>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;PageIndex&lt;/TITLE&gt;
&lt;SCRIPT LANGUAGE="JavaScript"&gt;
function changeImage(filename)
{
parent.pageviewer.document.images['mainimage'].src = filename;
}
&lt;/script&gt;
&lt;/HEAD&gt;
&lt;BODY bgcolor="#DDDDDD"&gt;{Body}&lt;/BODY&gt;
&lt;/HTML&gt;</value>
</data>
<data name="FrameHtml" xml:space="preserve">
<value>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;PDF to Image Html&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;FRAMESET ROWS="50,*" FRAMEBORDER=0 BORDER=0 &gt;
&lt;FRAME NAME="top" SRC="content/top.html" MARGINHEIGHT=0 MARGINWIDTH=0 NORESIZE&gt;
&lt;FRAMESET COLS="20%,80%" FRAMEBORDER=0 BORDER=0&gt;
&lt;FRAME NAME="left" SRC="content/bookmark.html" MARGINHEIGHT=0 MARGINWIDTH=0 SCROLLING=AUTO NORESIZE&gt;
&lt;FRAMESET ROWS="*,25" FRAMEBORDER=0 BORDER=0 &gt;
&lt;FRAME NAME="pageviewer" SRC="content/page.html" MARGINHEIGHT=0 MARGINWIDTH=0 SCROLLING=AUTO NORESIZE&gt;
&lt;FRAME NAME="pagesize" SRC="content/pagesize.html" MARGINHEIGHT=0 MARGINWIDTH=0 NORESIZE&gt;
&lt;/FRAMESET&gt;
&lt;/FRAMESET&gt;
&lt;/HTML&gt;</value>
</data>
<data name="PageHtml" xml:space="preserve">
<value>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;PageViewer&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;BODY bgcolor="#999999"&gt;&lt;center&gt;&lt;img id="mainimage" src="images/page1.png" width="100%"&gt;&lt;/center&gt;&lt;/BODY&gt;
&lt;/HTML&gt;</value>
</data>
<data name="PagesizeHtml" xml:space="preserve">
<value>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;PageSize&lt;/TITLE&gt;
&lt;SCRIPT LANGUAGE="JavaScript"&gt;
function fitScreen()
{
parent.pageviewer.document.images['mainimage'].style.height = '100%';
parent.pageviewer.document.images['mainimage'].style.width = 'auto';
}
function fitWidth()
{
parent.pageviewer.document.images['mainimage'].style.height = 'auto';
parent.pageviewer.document.images['mainimage'].style.width = '100%';
}
function fitActual()
{
parent.pageviewer.document.images['mainimage'].style.height = 'auto';
parent.pageviewer.document.images['mainimage'].style.width = 'auto';
}
&lt;/script&gt;
&lt;/HEAD&gt;
&lt;BODY bgcolor="#BBBBBB"&gt;
&lt;center&gt;
&lt;a href="javascript:fitScreen()"&gt;Fit To Screen&lt;/a&gt;&amp;nbsp;&amp;nbsp;
&lt;a href="javascript:fitWidth()"&gt;Fit To Width&lt;/a&gt;&amp;nbsp;&amp;nbsp;
&lt;a href="javascript:fitActual()"&gt;Actual Size&lt;/a&gt;
&lt;/center&gt;&lt;/BODY&gt;
&lt;/HTML&gt;</value>
</data>
<data name="TopHtml" xml:space="preserve">
<value>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;DocumentName&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;BODY bgcolor="#BBBBBB"&gt;{DocumentName}&lt;/BODY&gt;
&lt;/HTML&gt;</value>
</data>
</root>

View File

@@ -0,0 +1,73 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:2.0.50727.3074
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings),MySettings)
#Region "My.Settings Auto-Save Functionality"
#If _MyType = "WindowsForms" Then
Private Shared addedHandler As Boolean
Private Shared addedHandlerLockObject As New Object
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then
My.Settings.Save()
End If
End Sub
#End If
#End Region
Public Shared ReadOnly Property [Default]() As MySettings
Get
#If _MyType = "WindowsForms" Then
If Not addedHandler Then
SyncLock addedHandlerLockObject
If Not addedHandler Then
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
addedHandler = True
End If
End SyncLock
End If
#End If
Return defaultInstance
End Get
End Property
End Class
End Namespace
Namespace My
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.PDFView.My.MySettings
Get
Return Global.PDFView.My.MySettings.Default
End Get
End Property
End Module
End Namespace

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@@ -0,0 +1,175 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{170D7D1B-61B9-4E8B-9CD3-88350725379F}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>PDFView</RootNamespace>
<AssemblyName>PDFView</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<OptionExplicit>On</OptionExplicit>
<OptionCompare>Binary</OptionCompare>
<OptionStrict>Off</OptionStrict>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>PDFView.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>PDFView.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="itextsharp, Version=4.1.2.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca">
<SpecificVersion>False</SpecificVersion>
<HintPath>lib\itextsharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PDFLibNet, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>lib\PDFLibNet.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.XML" />
<Reference Include="tessnet2_32, Version=2.0.4.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>lib\tessnet2_32.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Diagnostics" />
</ItemGroup>
<ItemGroup>
<Compile Include="AFPDFLibUtil.vb" />
<Compile Include="ExportImageOptions.Designer.vb">
<DependentUpon>ExportImageOptions.vb</DependentUpon>
</Compile>
<Compile Include="ExportImageOptions.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="ExportOptions.Designer.vb">
<DependentUpon>ExportOptions.vb</DependentUpon>
</Compile>
<Compile Include="ExportOptions.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="GhostScriptLib.vb" />
<Compile Include="ImageUtil.vb" />
<Compile Include="ImportProgress.Designer.vb">
<DependentUpon>ImportProgress.vb</DependentUpon>
</Compile>
<Compile Include="ImportProgress.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="iTextSharpUtil.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="Password.Designer.vb">
<DependentUpon>Password.vb</DependentUpon>
</Compile>
<Compile Include="Password.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="PDFViewer.Designer.vb">
<DependentUpon>PDFViewer.vb</DependentUpon>
</Compile>
<Compile Include="PDFViewer.vb">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="PrinterUtil.vb" />
<Compile Include="TesseractOCR.vb" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ExportImageOptions.resx">
<DependentUpon>ExportImageOptions.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="ExportOptions.resx">
<DependentUpon>ExportOptions.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="ImportProgress.resx">
<DependentUpon>ImportProgress.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Password.resx">
<DependentUpon>Password.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="PDFViewer.resx">
<DependentUpon>PDFViewer.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>copy "$(ProjectDir)lib\gsdll32.dll" "$(TargetDir)"
copy "$(ProjectDir)lib\itextsharp.dll" "$(TargetDir)"
copy "$(ProjectDir)lib\PDFLibNET.dll" "$(TargetDir)"
copy "$(ProjectDir)lib\tessnet2_32.dll" "$(TargetDir)"
xcopy "$(ProjectDir)lib\tessdata" "$(TargetDir)tessdata" /s /e /i /h /Y</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@@ -0,0 +1,336 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class PDFViewer
Inherits System.Windows.Forms.UserControl
'UserControl overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(PDFViewer))
Me.ToolStrip1 = New System.Windows.Forms.ToolStrip
Me.tsPrint = New System.Windows.Forms.ToolStripButton
Me.ToolStripSeparator4 = New System.Windows.Forms.ToolStripSeparator
Me.tsPageLabel = New System.Windows.Forms.ToolStripLabel
Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator
Me.tsPrevious = New System.Windows.Forms.ToolStripButton
Me.tsNext = New System.Windows.Forms.ToolStripButton
Me.ToolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator
Me.ToolStripLabel2 = New System.Windows.Forms.ToolStripLabel
Me.tsPageNum = New System.Windows.Forms.ToolStripTextBox
Me.ToolStripSeparator3 = New System.Windows.Forms.ToolStripSeparator
Me.tsZoomOut = New System.Windows.Forms.ToolStripButton
Me.tsZoomIn = New System.Windows.Forms.ToolStripButton
Me.tsRotateCC = New System.Windows.Forms.ToolStripButton
Me.tsRotateC = New System.Windows.Forms.ToolStripButton
Me.ToolStripLabel3 = New System.Windows.Forms.ToolStripLabel
Me.tscbZoom = New System.Windows.Forms.ToolStripComboBox
Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel
Me.tsBottom = New System.Windows.Forms.ToolStrip
Me.tbSearchText = New System.Windows.Forms.ToolStripTextBox
Me.btSearch = New System.Windows.Forms.ToolStripButton
Me.btNext = New System.Windows.Forms.ToolStripButton
Me.ToolStripSeparator5 = New System.Windows.Forms.ToolStripSeparator
Me.tsExport = New System.Windows.Forms.ToolStripButton
Me.tsImport = New System.Windows.Forms.ToolStripButton
Me.TreeView1 = New System.Windows.Forms.TreeView
Me.Panel1 = New System.Windows.Forms.Panel
Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog
Me.SaveFileDialog1 = New System.Windows.Forms.SaveFileDialog
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.ToolStrip1.SuspendLayout()
Me.TableLayoutPanel1.SuspendLayout()
Me.tsBottom.SuspendLayout()
Me.SuspendLayout()
'
'ToolStrip1
'
Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tsPrint, Me.ToolStripSeparator4, Me.tsPageLabel, Me.ToolStripSeparator1, Me.tsPrevious, Me.tsNext, Me.ToolStripSeparator2, Me.ToolStripLabel2, Me.tsPageNum, Me.ToolStripSeparator3, Me.tsZoomOut, Me.tsZoomIn, Me.tsRotateCC, Me.tsRotateC, Me.ToolStripLabel3, Me.tscbZoom})
Me.ToolStrip1.Location = New System.Drawing.Point(0, 0)
Me.ToolStrip1.Name = "ToolStrip1"
Me.ToolStrip1.Size = New System.Drawing.Size(543, 25)
Me.ToolStrip1.TabIndex = 0
Me.ToolStrip1.Text = "ToolStrip1"
'
'tsPrint
'
Me.tsPrint.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.tsPrint.Image = CType(resources.GetObject("tsPrint.Image"), System.Drawing.Image)
Me.tsPrint.ImageTransparentColor = System.Drawing.Color.Black
Me.tsPrint.Name = "tsPrint"
Me.tsPrint.Size = New System.Drawing.Size(23, 22)
Me.tsPrint.Text = "ToolStripButton1"
Me.tsPrint.ToolTipText = "Print"
'
'ToolStripSeparator4
'
Me.ToolStripSeparator4.Name = "ToolStripSeparator4"
Me.ToolStripSeparator4.Size = New System.Drawing.Size(6, 25)
'
'tsPageLabel
'
Me.tsPageLabel.Name = "tsPageLabel"
Me.tsPageLabel.Size = New System.Drawing.Size(112, 22)
Me.tsPageLabel.Text = "Page Number 1 of 1"
'
'ToolStripSeparator1
'
Me.ToolStripSeparator1.Name = "ToolStripSeparator1"
Me.ToolStripSeparator1.Size = New System.Drawing.Size(6, 25)
'
'tsPrevious
'
Me.tsPrevious.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.tsPrevious.Image = CType(resources.GetObject("tsPrevious.Image"), System.Drawing.Image)
Me.tsPrevious.ImageTransparentColor = System.Drawing.Color.Magenta
Me.tsPrevious.Name = "tsPrevious"
Me.tsPrevious.Size = New System.Drawing.Size(23, 22)
Me.tsPrevious.Text = "ToolStripButton1"
Me.tsPrevious.ToolTipText = "Previous Page"
'
'tsNext
'
Me.tsNext.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.tsNext.Image = CType(resources.GetObject("tsNext.Image"), System.Drawing.Image)
Me.tsNext.ImageTransparentColor = System.Drawing.Color.Magenta
Me.tsNext.Name = "tsNext"
Me.tsNext.Size = New System.Drawing.Size(23, 22)
Me.tsNext.Text = "ToolStripButton2"
Me.tsNext.ToolTipText = "Next Page"
'
'ToolStripSeparator2
'
Me.ToolStripSeparator2.Name = "ToolStripSeparator2"
Me.ToolStripSeparator2.Size = New System.Drawing.Size(6, 25)
'
'ToolStripLabel2
'
Me.ToolStripLabel2.Name = "ToolStripLabel2"
Me.ToolStripLabel2.Size = New System.Drawing.Size(65, 22)
Me.ToolStripLabel2.Text = "Go to page"
'
'tsPageNum
'
Me.tsPageNum.Name = "tsPageNum"
Me.tsPageNum.Size = New System.Drawing.Size(40, 25)
'
'ToolStripSeparator3
'
Me.ToolStripSeparator3.Name = "ToolStripSeparator3"
Me.ToolStripSeparator3.Size = New System.Drawing.Size(6, 25)
'
'tsZoomOut
'
Me.tsZoomOut.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.tsZoomOut.Image = CType(resources.GetObject("tsZoomOut.Image"), System.Drawing.Image)
Me.tsZoomOut.ImageTransparentColor = System.Drawing.Color.Magenta
Me.tsZoomOut.Name = "tsZoomOut"
Me.tsZoomOut.Size = New System.Drawing.Size(23, 22)
Me.tsZoomOut.Text = "ToolStripButton3"
Me.tsZoomOut.ToolTipText = "Zoom Out"
'
'tsZoomIn
'
Me.tsZoomIn.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.tsZoomIn.Image = CType(resources.GetObject("tsZoomIn.Image"), System.Drawing.Image)
Me.tsZoomIn.ImageTransparentColor = System.Drawing.Color.Magenta
Me.tsZoomIn.Name = "tsZoomIn"
Me.tsZoomIn.Size = New System.Drawing.Size(23, 22)
Me.tsZoomIn.Text = "ToolStripButton4"
Me.tsZoomIn.ToolTipText = "Zoom In"
'
'tsRotateCC
'
Me.tsRotateCC.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.tsRotateCC.Image = CType(resources.GetObject("tsRotateCC.Image"), System.Drawing.Image)
Me.tsRotateCC.ImageTransparentColor = System.Drawing.Color.Magenta
Me.tsRotateCC.Name = "tsRotateCC"
Me.tsRotateCC.Size = New System.Drawing.Size(23, 22)
Me.tsRotateCC.Text = "Rotate the page counterclockwise"
'
'tsRotateC
'
Me.tsRotateC.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.tsRotateC.Image = CType(resources.GetObject("tsRotateC.Image"), System.Drawing.Image)
Me.tsRotateC.ImageTransparentColor = System.Drawing.Color.Magenta
Me.tsRotateC.Name = "tsRotateC"
Me.tsRotateC.Size = New System.Drawing.Size(23, 22)
Me.tsRotateC.Text = "Rotate the page clockwise"
'
'ToolStripLabel3
'
Me.ToolStripLabel3.Name = "ToolStripLabel3"
Me.ToolStripLabel3.Size = New System.Drawing.Size(10, 22)
Me.ToolStripLabel3.Text = " "
'
'tscbZoom
'
Me.tscbZoom.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.tscbZoom.Name = "tscbZoom"
Me.tscbZoom.Size = New System.Drawing.Size(100, 25)
'
'TableLayoutPanel1
'
Me.TableLayoutPanel1.ColumnCount = 2
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20.0!))
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 80.0!))
Me.TableLayoutPanel1.Controls.Add(Me.tsBottom, 0, 1)
Me.TableLayoutPanel1.Controls.Add(Me.TreeView1, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Panel1, 1, 0)
Me.TableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill
Me.TableLayoutPanel1.Location = New System.Drawing.Point(0, 25)
Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
Me.TableLayoutPanel1.RowCount = 2
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
Me.TableLayoutPanel1.Size = New System.Drawing.Size(543, 401)
Me.TableLayoutPanel1.TabIndex = 2
'
'tsBottom
'
Me.TableLayoutPanel1.SetColumnSpan(Me.tsBottom, 2)
Me.tsBottom.Dock = System.Windows.Forms.DockStyle.Bottom
Me.tsBottom.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tbSearchText, Me.btSearch, Me.btNext, Me.ToolStripSeparator5, Me.tsExport, Me.tsImport})
Me.tsBottom.Location = New System.Drawing.Point(0, 376)
Me.tsBottom.Name = "tsBottom"
Me.tsBottom.Size = New System.Drawing.Size(543, 25)
Me.tsBottom.TabIndex = 7
Me.tsBottom.Text = "Export PDF to another file format"
'
'tbSearchText
'
Me.tbSearchText.Name = "tbSearchText"
Me.tbSearchText.Size = New System.Drawing.Size(100, 25)
'
'btSearch
'
Me.btSearch.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.btSearch.Image = CType(resources.GetObject("btSearch.Image"), System.Drawing.Image)
Me.btSearch.ImageTransparentColor = System.Drawing.Color.Magenta
Me.btSearch.Name = "btSearch"
Me.btSearch.Size = New System.Drawing.Size(23, 22)
Me.btSearch.Text = "Search"
'
'btNext
'
Me.btNext.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.btNext.Image = CType(resources.GetObject("btNext.Image"), System.Drawing.Image)
Me.btNext.ImageTransparentColor = System.Drawing.Color.Magenta
Me.btNext.Name = "btNext"
Me.btNext.Size = New System.Drawing.Size(23, 22)
Me.btNext.Text = "Search for next match"
'
'ToolStripSeparator5
'
Me.ToolStripSeparator5.Name = "ToolStripSeparator5"
Me.ToolStripSeparator5.Size = New System.Drawing.Size(6, 25)
'
'tsExport
'
Me.tsExport.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.tsExport.Image = CType(resources.GetObject("tsExport.Image"), System.Drawing.Image)
Me.tsExport.ImageTransparentColor = System.Drawing.Color.Magenta
Me.tsExport.Name = "tsExport"
Me.tsExport.Size = New System.Drawing.Size(23, 22)
Me.tsExport.Text = "Export PDF to another file format"
'
'tsImport
'
Me.tsImport.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.tsImport.Image = CType(resources.GetObject("tsImport.Image"), System.Drawing.Image)
Me.tsImport.ImageTransparentColor = System.Drawing.Color.Magenta
Me.tsImport.Name = "tsImport"
Me.tsImport.Size = New System.Drawing.Size(23, 22)
Me.tsImport.Text = "Import images to the PDF file format"
'
'TreeView1
'
Me.TreeView1.Dock = System.Windows.Forms.DockStyle.Fill
Me.TreeView1.Location = New System.Drawing.Point(3, 3)
Me.TreeView1.Name = "TreeView1"
Me.TreeView1.Size = New System.Drawing.Size(102, 370)
Me.TreeView1.TabIndex = 2
'
'Panel1
'
Me.Panel1.AutoScroll = True
Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
Me.Panel1.Location = New System.Drawing.Point(111, 3)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(429, 370)
Me.Panel1.TabIndex = 8
'
'OpenFileDialog1
'
Me.OpenFileDialog1.FileName = "OpenFileDialog1"
'
'Timer1
'
Me.Timer1.Interval = 250
'
'PDFViewer
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.Controls.Add(Me.TableLayoutPanel1)
Me.Controls.Add(Me.ToolStrip1)
Me.Name = "PDFViewer"
Me.Size = New System.Drawing.Size(543, 426)
Me.ToolStrip1.ResumeLayout(False)
Me.ToolStrip1.PerformLayout()
Me.TableLayoutPanel1.ResumeLayout(False)
Me.TableLayoutPanel1.PerformLayout()
Me.tsBottom.ResumeLayout(False)
Me.tsBottom.PerformLayout()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip
Friend WithEvents tsPageLabel As System.Windows.Forms.ToolStripLabel
Friend WithEvents ToolStripSeparator1 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents tsPrevious As System.Windows.Forms.ToolStripButton
Friend WithEvents tsNext As System.Windows.Forms.ToolStripButton
Friend WithEvents ToolStripSeparator2 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents ToolStripLabel2 As System.Windows.Forms.ToolStripLabel
Friend WithEvents tsPageNum As System.Windows.Forms.ToolStripTextBox
Friend WithEvents ToolStripSeparator3 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents tsZoomOut As System.Windows.Forms.ToolStripButton
Friend WithEvents tsZoomIn As System.Windows.Forms.ToolStripButton
Friend WithEvents tscbZoom As System.Windows.Forms.ToolStripComboBox
Friend WithEvents ToolStripLabel3 As System.Windows.Forms.ToolStripLabel
Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel
Friend WithEvents TreeView1 As System.Windows.Forms.TreeView
Friend WithEvents tsPrint As System.Windows.Forms.ToolStripButton
Friend WithEvents ToolStripSeparator4 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents tsRotateCC As System.Windows.Forms.ToolStripButton
Friend WithEvents tsRotateC As System.Windows.Forms.ToolStripButton
Friend WithEvents tsBottom As System.Windows.Forms.ToolStrip
Friend WithEvents tbSearchText As System.Windows.Forms.ToolStripTextBox
Friend WithEvents btSearch As System.Windows.Forms.ToolStripButton
Friend WithEvents btNext As System.Windows.Forms.ToolStripButton
Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog
Friend WithEvents SaveFileDialog1 As System.Windows.Forms.SaveFileDialog
Friend WithEvents ToolStripSeparator5 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents tsExport As System.Windows.Forms.ToolStripButton
Friend WithEvents tsImport As System.Windows.Forms.ToolStripButton
Friend WithEvents Timer1 As System.Windows.Forms.Timer
Friend WithEvents Panel1 As System.Windows.Forms.Panel
End Class

View File

@@ -0,0 +1,325 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="ToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="tsPrint.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAATRJREFUOE+Nk81K
w0AUhacP0218gGwESbJ152sEt24EEUSwBlRQxFJUWlQkFawttI1EBXVjUdDszEJQ/MGNILgwR87AQJKG
OoGPMPd+594sJiWRe/b6t8jX0uepibHSqL7ggCRJCvlvuBxM6ev7pxCtATPzHg5PThE/f2Zgjb2hz59b
XEYaStX9NsLBYwbW2Mv7YqGyAr/Vk5TLZS2Uz6yorG7gqB1IDMPQQvnMirXNGlrdM4lt21oon1mxtdNA
L7yUuK6rhfKZFfUDH57n4eL6BkEQaEGXMCv84w4Gdw+SOI61oMulzIpOP5QHYlmWFq9vHxhvToJZsb1b
RxRFEsdxMD27hPVaoxD26CifWaG2822aJqrNczy9vKN7dZ+BNfbopDNDN5P3/TdBIVr/AqVR5Df+AR+9
OgdeCi45AAAAAElFTkSuQmCC
</value>
</data>
<data name="tsPrevious.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAwJJREFUOE91k11M
01cYxl+n4BLC1vEh4hDxxtVEzYxfURNDNJkOMDUVhCr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SreOV5xvoB+MZ5dvN2W3Sjj9eyvddzoIOR8SUFbXPVvOdtGHOEICiRfS2HE5l7gLycSNbSN1KgvDNwdp
+7kVw80Sws6HzYj7eR/KJuHSLTYVFD0cS9zoZuKvJLJpTE/kYKRfubTj0q/M+Z/+Bc5J9EZzI7QTAAAA
AElFTkSuQmCC
</value>
</data>
<data name="tsZoomOut.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAmNJREFUOE+Nk99P
klEcxuvSq5oXXfsHdOFc46Ybty7cummrARtd8A5fYc2pL1QSaaMgyxnypnOQRZBmVGyMZaVltdnImrIF
y5bIJEWs+GWi4K8Ins6BLnxHus727D3be87n+zzf787+fTuWnrdWHaio0Ofy+arKykO1yUQ8kEilApm1
zMDdno7xnWfL9ub+Qb7P/giu5168nPiCN5NzcL/y49aDETS3d0Far+F3BZis9/g7zmFMBCJYiG3h23Ie
33/msZjMIbiYRb97Cmd0JkjqOUcZpM/hqjb3D2FyOop4uoDkGkpaBRJE8TQwE92C0fYODec7cEreWCuA
tHWYHc7ht4itFLC0DCwkQKoDKQKhoqA40YgvDW23CzKV1iMAaA0m/7gvVDy8ki2JVo0kgWiq5IJCPoYL
4J1TkDdfggDQdPE6fJ8XixfXNoDjrWEcawrgKOvFkdOjOHzyMebjwKcIcH80CPasUQhgGtvmX7+fRmYT
2Ngi2i4pS/YUmF4H5kksUgMPx0Jo1HUKAVJW7bntfEYuFbCdA34R0e/mX8gqgdAoM0uA/YkP6vYbfkEE
2lUl6e5cJIZ8AUXlfpcg1AmN9pVEmAxm0W1zQ6PvYspGSV0YbtrxI0naTxaFUCfrJAadiG82DWPPAJSc
DmKxuLoMcELeclDKnvOoL/Nwv/AW3YTIGKbDKYx9CMEy9BQNXDu02guoq6tbYVm2HEKpYkULo9Rc8bde
7SUVHejsG8S1XpvfYLIyHo+HsVgskEgke0P2ejAqlUoAkclk/3byvxCRSJTY84Xu9lOhUDAcx6Gmpob5
A8rd9wxr3WF7AAAAAElFTkSuQmCC
</value>
</data>
<data name="tsZoomIn.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAmNJREFUOE+Nk99P
klEcxuvSq5oXXfsHdOFY86Ybty7YummrgRtd8A4JFk5BKom0URDlDH3VMYgiSXNUbIxlpdmPzUbWkC1Y
tlSmIWolP0wUNIzg6RzeLnxHss727D3be76f5/l+z87+fbuWgbXXHKiqMuQLhZrq6kP1yUQ8nEilwpnN
zODdPvPE7rNl+x7HEGsdeAjPMz/GJz/jdWAe3pch3HKPoqWjCw2NWnZPgMV+j73jHsFkOIbF1Ry+rhXw
7UcBS8k8ZpeycHincFZvgbhR4yqDWF2e2h7HMALTy4ini0hugtMGkCCKp4GZ5RxMzrc4c8GMU9Kmeh6k
3dzjco+8wep6EStrwGICxB043raA1F9QnIBGg2nouj2QKHU+HkBntIQmgpHS4fUsJ+p6rDmM5RSXgqb5
sFAE656CtOUyeIDmSzcQ/LRUKtzc5pxp8VG5H0dOj+HwyUeIxoGPMeD+2Czk50x8ANPUHn31bhqZn8B2
jmiHEy2mwPQWECVtEQ88eBFBk76TD2iQt/puu5+SoiJ28sAvIvqlzlkC3CAQ2srMCjDwOIjWjpshXgt0
qgoy3fnYKgpFlJT/zUFoEtraF9JCYDaLbqcXWkMXU3aVNIWxdwDfk2T8ZFEITbJFEtAbCc6lYeodhEKt
h0gkqi0DnJCqDzbIz/tar7DwPveX0kRiSUwvpDD+PgLb8BMoNB3Q6S5CKBSuq1SqcgilimRqRqG9Gmq7
1g9jnwud1iFc73eGjBY74/P5GJvNBrFYXBlS6cEolUoeRCKR/DvJ/0Lq6uoSFV/oXj9lMhmj0WggEAiY
P7jh8TZUkcROAAAAAElFTkSuQmCC
</value>
</data>
<data name="tsRotateCC.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgFJREFUOE+dkm9r
01AUxqOCCL4ZfoGJVWN1s9LZdWu7NBVG0TcJiivVyUo3V8Y624Ru9o+4ou8E6ScQ/AZjnyCIbmU2kg3T
pq5NokzfWt9aCs+SFKWWSKEXDtx7z3N+59yHe+Lqonyu9mbsJ9G3Rply7OyZk8yp08QIOgTxu9Mh2u32
tiF7+2079Ouv3LkgiaOMMPLnwnF3h51YrOhM/hDscxWzGw0E+UME0k14EnWQkXLLwQhsD2Af7vmyZEKM
ZCnMy4i81EBxCnwpBXSmiRleg59T4Us3EDD2rpgEQ9+FOBf2kXitWmQmp4DdbGIyKeN2XsPMEwXXHlZ0
Z1QUyHlRmliWQWW+WmHqrclNwNyLBuKvdNwrqvAmq7hT0OBZPmhdnNtN91rjiLynzcJQ9ghTyTou3X8X
swA0V8OtjIKptSrCeRU3Hx8YyQ83+o01z5ejO6xnpYpQ7gjkg92tLoCvwbP6GdPGm8M5HY7ont5rbD+I
NDyj8z9wJbonWIDZDcNlrg4f9wWTKRXulSYuRLrG2k1BPioXQ4XvGIuLkgX4X5gQO4AzLrJUVsP40ifB
Lj/wzpWo0FRWxfWlj1sDxXYC95qUptYbGE+IsaEAXl4ueTNKy5WSbD0aCPU+VaTp9WpxoNBOENxUzvsL
dT04bPfAM6XkLyj0UN3NIl9G/ueHHgPbqRVfZpRR6AAAAABJRU5ErkJggg==
</value>
</data>
<data name="tsRotateC.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAhFJREFUOE9jZEAC
8v7rBZj/sCRwc3H6szAzMvz/y8zw/c/fD7///Nl4b7P7AmS1ILa+/34BuJiyz9YA88RD7yPrr/0Pqb/9
363s5n/Xslv/Pcpv/7fLufxfO+LwfTX//QEwDfrx+wU0Ey7+B/Pl3TYF+BSc+h/Xfu+/Z8XN/z7Vd/57
Vt7971h8+79J1rX/pjnX/1sX3P1vkHDuv2b4oX6QZsOE4+fBBoCcbR5+4H1S173/0a13/7vmnfuvG37w
vGbIgf3KwYfuGydf/G+ed+e/Se71/7Yl9/6bZ177rx5+/L1rxYP/YANUfbcnxDZe+5/c8/C/WfiR9/Le
2x2Q/SrtvadAPfL0f0ugC6xKb/13qnr436Xy0X/f5icQAwxCdq1P7X3w37Pg/H9lnx1wP6IG7n4D7bjz
/23LHvy3rbr736X+4X+P5kcQA0xjD+5P6n743yD8wHn0UIbx5YGhrRxx8r5l0YP/JqV3/5uU3f1vAfOC
UfTh+1Et9/6rB+9uwGYASLNS+OnzFoUP/ltXPv5vWf3wv3Xto/92dVAvgFzgXXbtv2YYIoqQDQI5Ex9m
0A3Zu94m48J/YWfUwMPlHQxxJd+dCVoRJ/+LOO0oIFoTskJ++/UC4u6H3ou77+4nywCQJnHX3Q3i7ntw
xgJBg/nt9wNdsR3oiv0KBBXjUgD0goOU5z7yvQEyWMprvwGpLgAAMI4O1j/5+DAAAAAASUVORK5CYII=
</value>
</data>
<metadata name="tsBottom.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>213, 17</value>
</metadata>
<metadata name="tsBottom.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>213, 17</value>
</metadata>
<data name="btSearch.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAldJREFUOE+Nk99L
U2EYx1tRd9H+hP0JYxe79s5LJZjSIjaOyKFhHhVz7Qe0MeewX3MOzyiFrUDdReygRSWWdrMw1NRgZJKV
zg3dr7PN6dTN8+09G4EHnXXg4Twv5zwfPu/zPq/swonH8dBbd/WanJFdvKS4fEWmiEYTy/lcdqJwmAk8
93iyJ/+V5PfdbrnL84wbHpvA5MwiZufXMUMi9P4L+n3joGgj36AzKGsC+h77uNGJD/j6I4VYqoxtXkA8
I2AjUcLi9wzuPQmhuRbk0dCLxqHAS6xuZJHMAck8kCIh5gkS21lgaj6JTtcobrTenT1lYe4d4F4RbbEg
mgJ+J4CtdBXwF7QWF8CGvqG1uxcNOlohgRj7vPxCJIr0LpDdA3IkxFyEbSSJBTH4uUMsFnNot/nQ3MLU
SQC3exxYiGxWCneLQOGg+s7vA5kC8IsYrcaAz2tH6Hb5cZM2SgH6NuvSdHgFe6SweAQckCgeorIWIaLV
6hYQjuzB/GAELYxFCtBQ7e5+3xgpOkbpGCiVgcNSFSLaiI1ciwOvP23C6GL5U02kjW6FeEQf51YgCAIE
AGUCEk3yZCtiL5bXi2BH38LkcNvOnIXrurZGqtOOyekw8rv7BCBUDGLpMuYiCTwNTsHkHESPfYDTaDRn
D5RGxyhv3bHOdtk9GAm+QSA0g+HgO7h847zJ6bF12QeXzBYr6uvreYPhnKnUMWYlY+7VW5xum8XlrfP7
/XJRm+M4PcuyaGpq+jek1szTNC2BaLXa2vfjfyBqtTpR84Kd94GiKH1HRwdUKpX+D2ip3HdylLCsAAAA
AElFTkSuQmCC
</value>
</data>
<data name="btNext.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAwtJREFUOE91k39I
1Gccxz9lYmQ2U6KtmLtWTLdZOxlkaYpkmtrKH21C2vLXaZbzvJtuWkorr0uds8s8vR+kpgdqpZTCmWyN
W/0xWMy52GB/bHSw0QgirpjMaGOvfb9fVyywN7x54Hme9+v59XkWyUKySIos1ixPvUSuiFm+X3D+085m
yQltDfWnD2RQ723kI+8R6rz1HJqoZutAIsFngn1iE/3CkGaxJZ1LpusrJy1XO6gdPUqlp4ZyTzXGSx9z
bNLK8WtWNvS9hpyV4mchJ8S0TQk7rvdqwQ9GatlvL6OwowSD/TB5ZwvZP1KBYcyIxddOrGcT0qUcUdMn
otN1rgs41fClo1QN11IxZGSP9T1m52Y1V/bVkNXzLnvHDrBv3EDTDQvLXMv88wBl68ZxM03jzVQpK6vh
kqHDZFlz+ePRLKrUttRTReq5bHZPFFD+pYmdE+8gDuUoy1vCZlw3+qgeqaPIfZDslnwyT+WSdDKdTHse
gT8faBC1je/azvJTa4ga2Ej+VJEKuCwxjtdp/7yTQ8Nmsq353L7r1wIL6cHcQ7a7s1jriCZnqgBxik+i
nTFYJtso9lTyqjH2ueEnAw1TTbzZ9zbvXy9HXArg5e4oDRB5RIdUhKG3JJBi30Wqaw+ZvXnM3PmRx3//
o3niJy8J/Uns+CID07d18wDpEN/e3kLEtAJpCEeOhbPo00iWNq7C+fUQ92f/0jz6g5f04Z0U3iyg9LtS
TNNmFWAT+UyK43q2sN76FtKoAFojCOpaRWjji/jvzWkenB4nYySDiltl1P1Sw5nf2knwblUvcb4WgjqD
/GnubF44GYW0RxBsX82K5rWUXvyQ+skWkgdSKJo+QIPfjOu+Dduvbf9t/0k9KvUd3hMRSBvM4SXlVVTA
SreOV5xvoB+MZ5dvN2W3Sjj9eyvddzoIOR8SUFbXPVvOdtGHOEICiRfS2HE5l7gLycSNbSN1KgvDNwdp
+7kVw80Sws6HzYj7eR/KJuHSLTYVFD0cS9zoZuKvJLJpTE/kYKRfubTj0q/M+Z/+Bc5J9EZzI7QTAAAA
AElFTkSuQmCC
</value>
</data>
<data name="tsExport.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAltJREFUOE+Nkctv
ElEYxUeNiUv+hPoXuNMmpNa6cWGMGtOtrRtoIAQWTSAhkO66pGlEF8Q0odEEU4Uij7bSTmnBAWbMRO0j
KUVmCk1rGwPlMbzE49ypklYt6SS/zLnnfvd88829QJ3xZL3XVBfrdRqXKAGXrzy5+vBT8azaf/yst18l
zqr5XEgNAtHEO1dAlr6vEt/f5XNL99DY0SgQTTyy1zXk+PAdXi5GaeMxcKBHe0+naOKRva4hYmiAF8MD
+AOEQdQ3HnTWii/X/PcrWJZ1cBwHhXgIor8XWLuJGtenaJ/PB4/HA7fbDZfL5TgVwvN8jwwqpQZq1R84
2s8i+6YXjUQ/StE+RRcLEg4PShCFPTidzzA+Pt7TCZG7T+2IeeVwq9FG5VDA1ks1vvlvY/ftLUVLUhOV
ch27+e/w+0Ow2+1TSoDcWXWye2Y7j+J+Busv+k4RmkuBXuaUgM3NLKxWK4xGo4qSu4+ltzJK97+RKi1U
y02Uj+qdEUhAZnsXk5NOaLXaMYphmEIiySKV4sCyH8FyMiyHZDIFhkkgFosjurICml5GJLKI+fkFhMJh
BAIBTE9PF0gAypUqKlUJVRlJqkGq1VA7A6EkIF1No/mziYmJCVDBYFAJeD0zhxnvAryzEfj8i5h9twh/
YOk3tPymkd7+iqHlYQytDSPXysFms4Ei90oCnj5/hchSHHSUQXQ1idV4CjHCBxZx5pjPX9bxaG4Q1xM3
IDQE6PV6UA6HA+22fHXnHOHkaBqNBpTZbC5YLBaMjo7CZDLBYDBAp9NhZGSE/GWQoi4UfgFO5IMdoefy
GgAAAABJRU5ErkJggg==
</value>
</data>
<data name="tsImport.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAllJREFUOE+VkN1L
U3Ech+c/EHoRdBFkN5oQoQQmvWHSC9VViEEQaBBOFNHA0PAFLwIvZ5JFeSHNKJCFbW5OZTo3nXM7i0VW
gvNlpmZlOnPbmc7W0znHFAsNPfBwPud7vuf58Dtxqh2uw88T2Ppq8mYgbqfdbecpuv1ctx3lqiUJOe/p
Y3k5w3iE+6O53Hl7DTnvWXDGfJwHU/eo+qhGzrsSpOmTvWn6FDa4O3yL2+7szef1ebJ3W5kgCBq728YF
QyZJukNkdaVzw3GFnP5LSpZnZ1szeKp9QlNTk+YvidfrTZQgtLzK16VFzpvOcfDlATJMxxTknNWeycTn
Gab8czQ2PqKuri5xUyK1N3+amiES/snaaoyF0CKn9SdJeLZP4ZSUvyzNEwquMDuzgMHQQU1NTbMikJrj
N9plwfiYJBKjTH+fI7U1lYuvLmO2D9LR6cba51EEIyOTVFZWUlJSEq+S2mt9o+NK+7+IoTXCwSjBHyss
BUTmvy0rgvGxWRoaGlGr1bUqp9MZGHIJuN0eBOENgkdC8OByuXE6hxgYcGCz27Fa+7BYeujq6qbDbMZo
NNLS0hKQBQRDYUJhkbCEKEYQIxEiO+Bf9uML+4j+ilJfX4/KZDIpglZdJ7q2btr0Fl4betC392Aw9v7B
Kt2t+MYmyO3LI/d9HtNr01RXV6PSarWK4OHjF1h6HVhtTmz9LvodbgZkBgUcznXeDX8guzOH9KET+Ff9
FBUVodJoNMRisV0fYevR8vPzUZWXlwcqKiooKyujtLSU4uJiCgsLKSgokP8y8tJ/CPwGaoI/8ifGcWcA
AAAASUVORK5CYII=
</value>
</data>
<metadata name="OpenFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>315, 17</value>
</metadata>
<metadata name="SaveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>457, 17</value>
</metadata>
<metadata name="Timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>124, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,977 @@
Imports System.Text.RegularExpressions
Imports System.Drawing.Imaging
Imports System.Drawing
Imports System.Windows.Forms
Imports PDFLibNet
Imports System.ComponentModel
Public Class PDFViewer
Private mOriginalFileName
Private mPDFFileName As String
Private mPDFPageCount As Integer
Private mCurrentPageNumber As Integer
Private m_PanStartPoint As Point
Private mBookmarks As ArrayList
Private mAllowBookmarks As Boolean = True
Private mUseXPDF As Boolean = True
Private mPDFDoc As PDFLibNet.PDFWrapper
Private FromBeginning As Boolean = True
Private XPDFPrintingPicBox As New PictureBox
Private mContinuousPages As Boolean = False
Private PageInitDone As Boolean = False
Private ScrollBarPosition As Integer = 0
Private ScrollUnitsPerPage As Integer = 0
Private ContinuousImages As List(Of System.Drawing.Image)
Private mUserPassword As String = ""
Private mOwnerPassword As String = ""
Private mPassword As String = ""
'Optimal render
Private mLastPageNumber As Integer
Private mResizeStopped As Boolean = False
Private mResizeCheckTimer As New Timer
Private mPDFViewerHeight As Integer
Private mPDFViewerWidth As Integer
Private mRotation As List(Of Integer)
Public Property FileName() As String
Get
Return mOriginalFileName
End Get
Set(ByVal value As String)
If Nothing = value Or value = "" Then
Exit Property
End If
mOriginalFileName = value
mUserPassword = ""
mOwnerPassword = ""
mPassword = ""
Dim userPassword As String = Nothing
If ImageUtil.IsTiff(value) Then
'Tiff Specific behavior
InitBottomToolbar("TIFF")
ElseIf ImageUtil.IsPDF(value) Then
Cursor.Current = Cursors.WaitCursor
If iTextSharpUtil.IsEncrypted(value) Then
FileIsEncrypted:
Dim frmPassword As New Password
Dim result As DialogResult = frmPassword.ShowDialog()
If result = DialogResult.OK Then
If Not frmPassword.OwnerPassword = "" Then
mOwnerPassword = frmPassword.OwnerPassword
If iTextSharpUtil.IsPasswordValid(value, frmPassword.OwnerPassword) = False Then
MsgBox("Owner password is incorrect.", MsgBoxStyle.Critical, "Incorrect Password")
Cursor.Current = Cursors.Default
Exit Property
Else
mOwnerPassword = frmPassword.OwnerPassword
mPassword = mOwnerPassword
End If
End If
If Not frmPassword.UserPassword = "" Then
If iTextSharpUtil.IsPasswordValid(value, frmPassword.UserPassword) = False Then
MsgBox("User password is incorrect.", MsgBoxStyle.Critical, "Incorrect Password")
Cursor.Current = Cursors.Default
Exit Property
Else
mUserPassword = frmPassword.UserPassword
mPassword = mUserPassword
End If
End If
End If
End If
If mUseXPDF Then
If Not Nothing Is mPDFDoc Then
mPDFDoc.Dispose()
End If
Try
mPDFDoc = New PDFLibNet.PDFWrapper("")
If mOwnerPassword <> "" Then
mPDFDoc.OwnerPassword = mOwnerPassword
mPassword = mOwnerPassword
End If
If mUserPassword <> "" Then
mPDFDoc.UserPassword = mUserPassword
mPassword = mUserPassword
End If
mPDFDoc.LoadPDF(value)
Catch ex As System.Security.SecurityException
GoTo FileIsEncrypted
Catch ex As Exception
If Not Nothing Is mPDFDoc Then
mPDFDoc.Dispose()
End If
GoTo GhostScriptFallBack
End Try
InitBottomToolbar("XPDF")
Else
GhostScriptFallBack:
InitBottomToolbar("GS")
End If
Else
Me.Enabled = False
End If
mPDFFileName = value
InitViewModes()
InitPageRange()
InitRotation()
InitializePageView(ViewMode.FIT_WIDTH)
If mAllowBookmarks And ImageUtil.IsPDF(mOriginalFileName) Then
InitBookmarks()
Else
HideBookmarks()
End If
DisplayCurrentPage()
tscbZoom.SelectedIndex = 1
Me.Enabled = True
Cursor.Current = Cursors.Default
End Set
End Property
'Public Property ContinuousPages() As Boolean
' Get
' Return mContinuousPages
' End Get
' Set(ByVal value As Boolean)
' mContinuousPages = value
' End Set
'End Property
Public Property UseXPDF() As Boolean
Get
Return mUseXPDF
End Get
Set(ByVal value As Boolean)
mUseXPDF = value
End Set
End Property
Public Property AllowBookmarks() As Boolean
Get
Return mAllowBookmarks
End Get
Set(ByVal value As Boolean)
mAllowBookmarks = value
If value = False Then
HideBookmarks()
End If
End Set
End Property
Public ReadOnly Property PageCount(ByVal FileName As String)
Get
Return ImageUtil.GetImageFrameCount(FileName)
End Get
End Property
Public ReadOnly Property Print(ByVal FileName As String)
Get
PrinterUtil.PrintImagesToPrinter(FileName)
Return 1
End Get
End Property
Public Sub SelectFile()
OpenFileDialog1.Filter = "PDF or TIFF files (*.pdf;*.tif)|*.pdf;*.tif"
OpenFileDialog1.FileName = ""
OpenFileDialog1.Title = "Select a PDF or TIFF file to open"
OpenFileDialog1.Multiselect = False
OpenFileDialog1.ShowDialog()
FileName = OpenFileDialog1.FileName
End Sub
Public Function OCRCurrentPage() As String
Cursor.Current = Cursors.WaitCursor
Dim TempFile As String = System.IO.Path.GetTempPath & Now.Ticks & ".txt"
OCRCurrentPage = ""
Try
AFPDFLibUtil.ExportPDF(mPDFDoc, TempFile, mCurrentPageNumber, mCurrentPageNumber)
OCRCurrentPage = System.IO.File.ReadAllText(TempFile)
System.IO.File.Delete(TempFile)
If Regex.IsMatch(OCRCurrentPage, "\w") = False Then
GoTo OCRCurrentImage
End If
Catch ex As Exception
If Regex.IsMatch(OCRCurrentPage, "\w") = False Then
GoTo OCRCurrentImage
End If
End Try
Cursor.Current = Cursors.Default
Exit Function
OCRCurrentImage:
Try
OCRCurrentPage = TesseractOCR.OCRImage(FindPictureBox("SinglePicBox").Image, TesseractOCR.Language.English)
Catch ex As Exception
'OCR failed
End Try
Cursor.Current = Cursors.Default
End Function
Private Sub ConvertGraphicsToPDF()
OpenFileDialog1.Filter = "Image Files(*.BMP;*.JPG;*.GIF;*.PNG;*.TIF)|*.BMP;*.JPG;*.GIF;*.PNG;*.TIF"
OpenFileDialog1.FileName = ""
OpenFileDialog1.Title = "Select multiple image files to convert to PDF"
OpenFileDialog1.Multiselect = True
If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
Dim exportOptionsDialog As New ExportImageOptions(OpenFileDialog1.FileNames)
exportOptionsDialog.ShowDialog()
Try
FileName = exportOptionsDialog.SavedFileName
Catch ex As Exception
'do nothing
End Try
End If
End Sub
Private Sub PDFViewer_ControlRemoved(ByVal sender As Object, ByVal e As System.Windows.Forms.ControlEventArgs) Handles Me.ControlRemoved
If Not Nothing Is mPDFDoc Then
mPDFDoc.Dispose()
End If
End Sub
Private Sub PDFViewer_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
If Not Nothing Is mPDFDoc Then
mPDFDoc.Dispose()
End If
End Sub
Private Sub PDFViewer_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Do something on control load
HideBookmarks()
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Me.Height = mPDFViewerHeight And Me.Width = mPDFViewerWidth Then
If mResizeStopped = False Then
DisplayCurrentPage()
mResizeStopped = True
End If
Timer1.Enabled = False
End If
End Sub
Private Sub PDFViewer_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
If PageInitDone = True Then
CenterPicBoxInPanel(FindPictureBox("SinglePicBox"))
End If
End Sub
Private Sub tsPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsPrevious.Click
mLastPageNumber = mCurrentPageNumber
mCurrentPageNumber -= 1
DisplayCurrentPage()
End Sub
Private Sub tsNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsNext.Click
mLastPageNumber = mCurrentPageNumber
mCurrentPageNumber += 1
DisplayCurrentPage()
End Sub
Private Sub tsZoomOut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsZoomOut.Click
Dim objPictureBox As PictureBox = FindPictureBox(mCurrentPageNumber)
ImageUtil.PictureBoxZoomOut(objPictureBox)
objPictureBox.Refresh()
'tscbZoom.Text = GetCurrentScalePercentage() & " %"
DisplayCurrentPage()
End Sub
Private Sub tsZoomIn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsZoomIn.Click
'If GetCurrentScalePercentage() > 500 Then
' Exit Sub
'End If
Dim objPictureBox As PictureBox = FindPictureBox(mCurrentPageNumber)
ImageUtil.PictureBoxZoomIn(objPictureBox)
objPictureBox.Refresh()
'tscbZoom.Text = GetCurrentScalePercentage() & " %"
DisplayCurrentPage()
End Sub
Private Sub tsPageNum_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles tsPageNum.KeyPress
If (Asc(e.KeyChar) = Keys.Enter) Then
If tsPageNum.Text = "" Then
mCurrentPageNumber = 1
Else
mCurrentPageNumber = tsPageNum.Text
End If
DisplayCurrentPage()
Else
e.Handled = TrapKey(Asc(e.KeyChar))
End If
End Sub
Private Sub tsPageNum_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsPageNum.Leave
mCurrentPageNumber = tsPageNum.Text
DisplayCurrentPage()
End Sub
Private Sub tscbZoom_Change(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tscbZoom.SelectedIndexChanged
Select Case tscbZoom.Text
Case "Fit To Screen"
If mContinuousPages Then
InitializePageView(ViewMode.FIT_TO_SCREEN)
Else
ApplyZoom(ViewMode.FIT_TO_SCREEN)
End If
Case "Actual Size"
If mContinuousPages Then
InitializePageView(ViewMode.ACTUAL_SIZE)
Else
ApplyZoom(ViewMode.ACTUAL_SIZE)
End If
Case "Fit To Width"
If mContinuousPages Then
InitializePageView(ViewMode.FIT_WIDTH)
Else
ApplyZoom(ViewMode.FIT_WIDTH)
End If
End Select
CenterPicBoxInPanel(FindPictureBox("SinglePicBox"))
DisplayCurrentPage()
End Sub
Private Sub tsPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsPrint.Click
If ImageUtil.IsPDF(mOriginalFileName) Or ImageUtil.IsTiff(mOriginalFileName) Then
PrinterUtil.PrintImagesToPrinter(mOriginalFileName)
End If
End Sub
Private Sub tsRotateCC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsRotateCC.Click
mRotation(mCurrentPageNumber - 1) -= 1
ImageUtil.RotateImageCounterclockwise(FindPictureBox(mCurrentPageNumber))
End Sub
Private Sub tsRotateC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsRotateC.Click
mRotation(mCurrentPageNumber - 1) += 1
ImageUtil.RotateImageClockwise(FindPictureBox(mCurrentPageNumber))
End Sub
Private Sub tsExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsExport.Click
If ImageUtil.IsPDF(mOriginalFileName) Then
Dim exportOptionsDialog As New ExportOptions(mPDFFileName, mPDFDoc, mPassword)
exportOptionsDialog.ShowDialog()
ElseIf ImageUtil.IsTiff(mOriginalFileName) Then
Dim FileArray(0) As String
FileArray(0) = mPDFFileName
Dim exportOptionsDialog As New ExportImageOptions(FileArray)
exportOptionsDialog.ShowDialog()
End If
Me.Focus()
End Sub
Private Sub tsImport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsImport.Click
ConvertGraphicsToPDF()
End Sub
#Region "Constraints"
Private Sub CheckPageBounds()
If mCurrentPageNumber >= mPDFPageCount Then
mCurrentPageNumber = mPDFPageCount
tsNext.Enabled = False
ElseIf mCurrentPageNumber <= 1 Then
mCurrentPageNumber = 1
tsPrevious.Enabled = False
End If
If mCurrentPageNumber < mPDFPageCount And mPDFPageCount > 1 And mCurrentPageNumber > 1 Then
tsNext.Enabled = True
tsPrevious.Enabled = True
End If
If mCurrentPageNumber = mPDFPageCount And mPDFPageCount > 1 And mCurrentPageNumber > 1 Then
tsPrevious.Enabled = True
End If
If mCurrentPageNumber = 1 And mPDFPageCount > 1 Then
tsNext.Enabled = True
End If
If mPDFPageCount = 1 Then
tsNext.Enabled = False
tsPrevious.Enabled = False
End If
End Sub
#End Region
#Region "Helper Functions"
Private Function GetImageFromFile(ByVal sFileName As String, ByVal iFrameNumber As Integer, Optional ByVal DPI As Integer = 0) As System.Drawing.Image
'Cursor.Current = Cursors.WaitCursor
GetImageFromFile = Nothing
If mUseXPDF And ImageUtil.IsPDF(sFileName) Then 'Use AFPDFLib (XPDF)
Try
GetImageFromFile = AFPDFLibUtil.GetImageFromPDF(mPDFDoc, iFrameNumber + 1, DPI)
Catch ex As Exception
InitBottomToolbar("GS")
GoTo GhostScriptFallBack
End Try
Else 'Use Ghostscript
GhostScriptFallBack:
If ImageUtil.IsPDF(sFileName) Then 'convert one frame to a tiff for viewing
GetImageFromFile = ConvertPDF.PDFConvert.GetPageFromPDF(sFileName, iFrameNumber + 1, DPI, mPassword)
ElseIf ImageUtil.IsTiff(sFileName) Then
GetImageFromFile = ImageUtil.GetFrameFromTiff(sFileName, iFrameNumber)
End If
End If
ImageUtil.ApplyRotation(GetImageFromFile, mRotation(iFrameNumber))
End Function
Private Sub InitPageRange()
mPDFPageCount = ImageUtil.GetImageFrameCount(mPDFFileName, mPassword)
mCurrentPageNumber = 1
End Sub
Private Sub InitBookmarks()
TreeView1.Nodes.Clear()
Dim HasBookmarks As Boolean = False
Try
If mUseXPDF Then
HasBookmarks = AFPDFLibUtil.FillTree(TreeView1, mPDFDoc)
AddHandler TreeView1.NodeMouseClick, AddressOf AFPDFLib_NodeMouseClick
RemoveHandler TreeView1.NodeMouseClick, AddressOf ItextSharp_NodeMouseClick
Else
HasBookmarks = iTextSharpUtil.BuildBookmarkTreeFromPDF(mOriginalFileName, TreeView1.Nodes, mPassword)
AddHandler TreeView1.NodeMouseClick, AddressOf ItextSharp_NodeMouseClick
RemoveHandler TreeView1.NodeMouseClick, AddressOf AFPDFLib_NodeMouseClick
End If
Catch ex As Exception
'Some bookmark structures do not parse from XML yet.
'TODO
End Try
If HasBookmarks Then
ShowBookmarks()
TreeView1.ExpandAll()
TreeView1.SelectedNode = TreeView1.Nodes.Item(0)
Else
HideBookmarks()
End If
End Sub
Private Sub InitBottomToolbar(ByVal Mode As String)
If Mode = "TIFF" Then
btSearch.Visible = False
btNext.Visible = False
tbSearchText.Visible = False
ToolStripSeparator5.Visible = False
tsExport.Visible = True
tsExport.ToolTipText = "Export TIFF file to the PDF file format"
ElseIf Mode = "GS" Then
btSearch.Visible = False
btNext.Visible = False
tbSearchText.Visible = False
ToolStripSeparator5.Visible = False
tsExport.Visible = False
ElseIf Mode = "XPDF" Then
btSearch.Visible = True
btNext.Visible = True
tbSearchText.Visible = True
ToolStripSeparator5.Visible = True
tsExport.Visible = True
tsExport.ToolTipText = "Export PDF to another file format"
End If
End Sub
Private Sub HideBookmarks()
TreeView1.Visible = False
TableLayoutPanel1.SetColumnSpan(TreeView1, 2)
TableLayoutPanel1.SetColumnSpan(Panel1, 2)
TableLayoutPanel1.SetColumn(Panel1, 0)
TableLayoutPanel1.SetColumn(TreeView1, 1)
End Sub
Private Sub ShowBookmarks()
TreeView1.Visible = True
TableLayoutPanel1.SetColumnSpan(TreeView1, 1)
TableLayoutPanel1.SetColumnSpan(Panel1, 1)
TableLayoutPanel1.SetColumn(Panel1, 1)
TableLayoutPanel1.SetColumn(TreeView1, 0)
End Sub
Public Enum ViewMode
FIT_TO_SCREEN
FIT_WIDTH
ACTUAL_SIZE
End Enum
Private Sub InitRotation()
mRotation = New List(Of Integer)
For i As Integer = 1 To mPDFPageCount
mRotation.Add(0)
Next
End Sub
Private Sub InitViewModes()
tscbZoom.Items.Clear()
tscbZoom.Items.Add("Fit To Screen")
tscbZoom.Items.Add("Fit To Width")
If ImageUtil.IsTiff(mPDFFileName) Then
tscbZoom.Items.Add("Actual Size")
End If
End Sub
Private Sub InitializePageView(Optional ByVal Mode As ViewMode = ViewMode.FIT_TO_SCREEN)
Dim myFlowLayoutPanel As New FlowLayoutPanel
Panel1.SuspendLayout()
Panel1.Controls.Clear()
If mContinuousPages Then
myFlowLayoutPanel.Dock = DockStyle.Fill
myFlowLayoutPanel.FlowDirection = FlowDirection.TopDown
myFlowLayoutPanel.AutoScroll = True
myFlowLayoutPanel.Width = Panel1.Width - 20
myFlowLayoutPanel.Height = Panel1.Height - 20
myFlowLayoutPanel.WrapContents = False
AddHandler myFlowLayoutPanel.Scroll, AddressOf FlowPanel_Scroll
For i As Integer = 1 To mPDFPageCount
Dim ObjPictureBox As New PictureBox
ObjPictureBox.Name = i.ToString
ObjPictureBox.SizeMode = PictureBoxSizeMode.Zoom
ObjPictureBox.Height = myFlowLayoutPanel.Height - 14
ObjPictureBox.Width = myFlowLayoutPanel.Width - 14
ObjPictureBox.Location = New Point(0, 0)
AddHandler ObjPictureBox.MouseUp, AddressOf picImage_MouseUp
AddHandler ObjPictureBox.MouseDown, AddressOf picImage_MouseDown
AddHandler ObjPictureBox.MouseMove, AddressOf picImage_MouseMove
'ObjPictureBox.Image = New System.Drawing.Bitmap(1, 1)
'ShowImageFromFile(mPDFFileName, i - 1, ObjPictureBox)
myFlowLayoutPanel.Controls.Add(ObjPictureBox)
Next
Dim EndPictureBox As New PictureBox
EndPictureBox.Name = "0"
EndPictureBox.Height = 1
EndPictureBox.Width = 1
EndPictureBox.Location = New Point(0, 0)
myFlowLayoutPanel.Controls.Add(EndPictureBox)
ApplyToAllPictureBoxes(myFlowLayoutPanel, Mode)
Panel1.Controls.Add(myFlowLayoutPanel)
ScrollUnitsPerPage = FindFlowLayoutPanel().VerticalScroll.Maximum / mPDFPageCount
Else
Dim objPictureBox As New PictureBox
objPictureBox.Name = "SinglePicBox"
Panel1.Controls.Add(objPictureBox)
objPictureBox.SizeMode = PictureBoxSizeMode.Zoom
objPictureBox.Dock = DockStyle.None
objPictureBox.Height = Panel1.Height - 14
objPictureBox.Width = Panel1.Width - 14
objPictureBox.Location = New Point(0, 0)
AddHandler objPictureBox.MouseUp, AddressOf picImage_MouseUp
AddHandler objPictureBox.MouseDown, AddressOf picImage_MouseDown
AddHandler objPictureBox.MouseMove, AddressOf picImage_MouseMove
ApplyToAllPictureBoxes(Panel1, Mode)
End If
Panel1.ResumeLayout()
PageInitDone = True
End Sub
Private Sub ApplyZoom(ByVal Mode As ViewMode)
Dim oPictureBox As PictureBox = FindPictureBox("SinglePicBox")
If Mode = ViewMode.FIT_TO_SCREEN Then
Dim picHeight As Integer = oPictureBox.Height
Dim picWidth As Integer = oPictureBox.Width
Dim parentHeight As Integer = oPictureBox.Parent.ClientSize.Height - 14
Dim parentWidth As Integer = oPictureBox.Parent.ClientSize.Width - 14
Dim HScale As Single = parentWidth / picWidth
Dim VScale As Single = parentHeight / picHeight
If VScale > HScale Then
oPictureBox.Height = picHeight * HScale
oPictureBox.Width = picWidth * HScale
Else
oPictureBox.Height = picHeight * VScale
oPictureBox.Width = picWidth * VScale
End If
ElseIf Mode = ViewMode.FIT_WIDTH And Not Nothing Is oPictureBox.Image Then
oPictureBox.Width = oPictureBox.Parent.ClientSize.Width - 18
Dim ScaleAmount As Double = (oPictureBox.Width / oPictureBox.Image.Width)
oPictureBox.Height = CInt(oPictureBox.Image.Height * ScaleAmount)
ElseIf Mode = ViewMode.ACTUAL_SIZE And Not Nothing Is oPictureBox.Image Then
oPictureBox.Width = oPictureBox.Image.Width
oPictureBox.Height = oPictureBox.Image.Height
End If
CenterPicBoxInPanel(FindPictureBox("SinglePicBox"))
'tscbZoom.Text = GetCurrentScalePercentage() & " %"
End Sub
Private Sub MakePictureBox1To1WithImage(ByRef oPictureBox As PictureBox, Optional ByRef newImage As Drawing.Image = Nothing)
If Not Nothing Is newImage Then
oPictureBox.Width = newImage.Width
oPictureBox.Height = newImage.Height
Else
oPictureBox.Width = oPictureBox.Image.Width
oPictureBox.Height = oPictureBox.Image.Height
End If
End Sub
Private Sub AutoRotatePicBox(ByRef oPictureBox As PictureBox, ByRef newImage As Drawing.Image)
Dim picHeight As Integer = oPictureBox.Height
Dim picWidth As Integer = oPictureBox.Width
Dim imgHeight As Integer = newImage.Height
Dim imgWidth As Integer = newImage.Width
If (picWidth > picHeight And imgWidth < imgHeight) Or (picWidth < picHeight And imgWidth > imgHeight) Then
oPictureBox.Width = picHeight
oPictureBox.Height = picWidth
End If
End Sub
Private Sub CenterPicBoxInPanel(ByRef oPictureBox As PictureBox)
ImageUtil.RecalcPageLocation(oPictureBox)
End Sub
Private Delegate Sub ShowImage(ByVal sFileName As String, ByVal iFrameNumber As Integer, ByRef oPictureBox As PictureBox, ByVal XPDFDPI As Integer)
Private Sub FlowPanel_Scroll(ByVal sender As Object, ByVal e As System.Windows.Forms.ScrollEventArgs)
ScrollBarPosition = e.NewValue()
Dim ImagesWereLoaded As Boolean = False
For i As Integer = 0 To 1
Dim pageNumber As Integer = (System.Math.Floor(ScrollBarPosition / ScrollUnitsPerPage) + 1) + i
If pageNumber >= 1 And pageNumber <= mPDFPageCount Then
If Nothing Is FindPictureBox(pageNumber).Image Then
FindPictureBox(pageNumber).Image = GetImageFromFile(mPDFFileName, pageNumber - 1, 72)
ImagesWereLoaded = True
FindPictureBox(pageNumber).Refresh()
End If
End If
Next
If ImagesWereLoaded Then
Dim lastPage As Integer = System.Math.Floor(ScrollBarPosition / ScrollUnitsPerPage) + 2
If lastPage > mPDFPageCount Then
lastPage = mPDFPageCount
End If
Dim firstPage As Integer = System.Math.Floor(ScrollBarPosition / ScrollUnitsPerPage) + 1
If firstPage < 1 Then
firstPage = 1
End If
ClearAllPictureBoxes(firstPage, lastPage)
End If
mCurrentPageNumber = System.Math.Floor(ScrollBarPosition / ScrollUnitsPerPage) + 1
UpdatePageLabel()
End Sub
Private Sub UpdatePageLabel()
tsPageLabel.Text = "Page " & mCurrentPageNumber & " of " & mPDFPageCount
tsPageNum.Text = mCurrentPageNumber
End Sub
'Private Sub DisplayCurrentPage()
' CheckPageBounds()
' UpdatePageLabel()
' ShowImageFromFile(mPDFFileName, mCurrentPageNumber - 1, FindPictureBox(mCurrentPageNumber))
' If mContinuousPages Then
' FindFlowLayoutPanel().ScrollControlIntoView(FindPictureBox(mCurrentPageNumber))
' ClearAllPictureBoxes(mCurrentPageNumber, mCurrentPageNumber)
' End If
'End Sub
Private Sub DisplayCurrentPage()
Dim oPict As PictureBox = FindPictureBox(mCurrentPageNumber)
If mLastPageNumber <> mCurrentPageNumber Then
CheckPageBounds()
UpdatePageLabel()
Dim newImage As Drawing.Image
If mUseXPDF Then
newImage = GetImageFromFile(mPDFFileName, mCurrentPageNumber - 1, AFPDFLibUtil.GetOptimalDPI(mPDFDoc, oPict))
Else
Dim optimalDPI As Integer = 0
If ImageUtil.IsPDF(mPDFFileName) Then
optimalDPI = iTextSharpUtil.GetOptimalDPI(mPDFFileName, mCurrentPageNumber, oPict, mPassword)
End If
newImage = GetImageFromFile(mPDFFileName, mCurrentPageNumber - 1, optimalDPI)
End If
If Not Nothing Is newImage Then
AutoRotatePicBox(oPict, newImage)
If ImageUtil.IsPDF(mPDFFileName) Then
MakePictureBox1To1WithImage(oPict, newImage)
End If
CenterPicBoxInPanel(oPict)
oPict.Image = newImage
End If
oPict.Refresh()
If mContinuousPages Then
FindFlowLayoutPanel().ScrollControlIntoView(oPict)
ClearAllPictureBoxes(mCurrentPageNumber, mCurrentPageNumber)
End If
Exit Sub
End If
AutoRotatePicBox(oPict, oPict.Image)
If ImageUtil.IsPDF(mPDFFileName) Then
MakePictureBox1To1WithImage(oPict, oPict.Image)
End If
CenterPicBoxInPanel(oPict)
End Sub
'Private Function GetCurrentScalePercentage() As Integer
' GetCurrentScalePercentage = 0
' Dim objPictureBox As PictureBox = FindPictureBox("SinglePicBox")
' If Not Nothing Is objPictureBox.Image Then
' Dim OriginalWidth As Integer = objPictureBox.Image.Width
' Dim CurrentWidth As Integer = objPictureBox.Width
' GetCurrentScalePercentage = CInt((CurrentWidth / OriginalWidth) * 100)
' End If
'End Function
Private Function FindPictureBox(ByVal controlName As String) As PictureBox
If mContinuousPages Then
FindPictureBox = FindControl(Panel1, controlName)
Else
FindPictureBox = FindControl(Panel1, "SinglePicBox")
End If
End Function
Public Function FindControl(ByVal container As Control, ByVal name As String) As Control
If container.Name = name Then
Return container
End If
For Each ctrl As Control In container.Controls
Dim foundCtrl As Control = FindControl(ctrl, name)
If foundCtrl IsNot Nothing Then
Return foundCtrl
End If
Next
Return Nothing
End Function
Private Sub ClearAllPictureBoxes(ByVal StartingPageNumber As Integer, ByVal EndingPageNumber As Integer)
Dim PagesToKeep As New List(Of String)
PagesToKeep.Add("0")
For i As Integer = StartingPageNumber To EndingPageNumber
PagesToKeep.Add(i.ToString)
Next
For Each oControl As Control In Panel1.Controls
For Each childControl As Control In oControl.Controls
If TypeOf childControl Is PictureBox And Not PagesToKeep.Contains(childControl.Name) Then
CType(childControl, PictureBox).Image = Nothing
End If
Next
Next
GC.Collect()
End Sub
Private Sub ApplyToAllPictureBoxes(ByRef oControl As Control, ByVal Mode As ViewMode)
Dim dummyPictureBox As New PictureBox
Dim optimalDPI As Integer = 0
If ImageUtil.IsPDF(mPDFFileName) Then
If mUseXPDF Then
optimalDPI = AFPDFLibUtil.GetOptimalDPI(mPDFDoc, dummyPictureBox)
End If
End If
dummyPictureBox.Image = GetImageFromFile(mPDFFileName, mCurrentPageNumber - 1, optimalDPI)
For Each childControl In oControl.Controls
If TypeOf childControl Is PictureBox Then
If Mode = ViewMode.FIT_TO_SCREEN Then
childControl.Height = childControl.Parent.ClientSize.Height - 14
childControl.Width = childControl.Parent.ClientSize.Width - 14
ElseIf Mode = ViewMode.FIT_WIDTH And Not Nothing Is dummyPictureBox.Image Then
childControl.Width = childControl.Parent.ClientSize.Width - 18
Dim ScaleAmount As Double = (childControl.Width / dummyPictureBox.Image.Width)
childControl.Height = CInt(dummyPictureBox.Image.Height * ScaleAmount)
ElseIf Mode = ViewMode.ACTUAL_SIZE And Not Nothing Is dummyPictureBox.Image Then
childControl.Width = dummyPictureBox.Image.Width
childControl.Height = dummyPictureBox.Image.Height
End If
End If
Next
GC.Collect()
End Sub
Private Function FindFlowLayoutPanel() As FlowLayoutPanel
FindFlowLayoutPanel = Nothing
For Each oControl In Panel1.Controls
If TypeOf oControl Is FlowLayoutPanel Then
Return oControl
End If
Next
End Function
Private Sub FitToScreen(Optional ByVal drawPage As Boolean = False)
If mContinuousPages Then
InitializePageView(ViewMode.FIT_TO_SCREEN)
DisplayCurrentPage()
Else
ApplyZoom(ViewMode.FIT_TO_SCREEN)
If drawPage Then
DisplayCurrentPage()
End If
End If
UpdatePageLabel()
End Sub
Private Function TrapKey(ByVal KCode As String) As Boolean
If (KCode >= 48 And KCode <= 57) Or KCode = 8 Then
TrapKey = False
Else
TrapKey = True
End If
End Function
#End Region
#Region "XPDF specific events"
Private Sub AFPDFLib_NodeMouseClick(ByVal sender As Object, ByVal e As TreeNodeMouseClickEventArgs)
Dim ol As OutlineItem = DirectCast(e.Node.Tag, OutlineItem)
If ol IsNot Nothing Then
Dim ret As Long = ol.DoAction()
Select Case ol.GetKind()
Case LinkActionKind.actionGoTo, LinkActionKind.actionGoToR
If Not mContinuousPages Then
ScrolltoTop(CInt(ret))
End If
Exit Select
Case LinkActionKind.actionLaunch
Exit Select
Case LinkActionKind.actionMovie
Exit Select
Case LinkActionKind.actionURI
Exit Select
End Select
mCurrentPageNumber = mPDFDoc.CurrentPage
DisplayCurrentPage()
End If
End Sub
Private Sub ScrolltoTop(ByVal y As Integer)
Dim dr As Point = Panel1.AutoScrollPosition
If mPDFDoc.PageHeight > Panel1.Height Then
dr.Y = y '* (GetCurrentScalePercentage() / 100)
End If
Panel1.AutoScrollPosition = dr
End Sub
Private Sub btSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btSearch.Click
Dim res As Integer = 0
Dim searchArgs As New SearchArgs(tbSearchText.Text, True, False, True, False, False)
res = SearchCallBack(sender, searchArgs)
End Sub
Private Sub btNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btNext.Click
Dim res As Integer = 0
res = SearchCallBack(sender, New SearchArgs(tbSearchText.Text, FromBeginning, False, True, True, False))
FromBeginning = False
If res = 0 Then
If MessageBox.Show("No results were found. Would you like to start from the beginning?", Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
FromBeginning = True
btNext_Click(Nothing, Nothing)
End If
End If
End Sub
Private Function SearchCallBack(ByVal sender As Object, ByVal e As SearchArgs) As Integer
Cursor.Current = Cursors.WaitCursor
Dim lFound As Integer = 0
If mPDFDoc IsNot Nothing Then
mPDFDoc.SearchCaseSensitive = e.Exact
If e.FromBegin Then
lFound = mPDFDoc.FindFirst(e.Text, If(e.WholeDoc, PDFLibNet.PDFSearchOrder.PDFSearchFromdBegin, PDFLibNet.PDFSearchOrder.PDFSearchFromCurrent), e.Up, False)
ElseIf e.FindNext Then
If e.Up Then
lFound = mPDFDoc.FindPrevious(e.Text)
Else
lFound = mPDFDoc.FindNext(e.Text)
End If
Else
lFound = mPDFDoc.FindText(e.Text, mPDFDoc.CurrentPage, (If(e.WholeDoc, PDFLibNet.PDFSearchOrder.PDFSearchFromdBegin, PDFLibNet.PDFSearchOrder.PDFSearchFromCurrent)), e.Exact, e.Up, True, _
e.WholeDoc)
End If
If lFound > 0 Then
mPDFDoc.CurrentPage = mPDFDoc.SearchResults(0).Page
mCurrentPageNumber = mPDFDoc.CurrentPage
DisplayCurrentPage()
If Not mContinuousPages Then
FocusSearchResult(mPDFDoc.SearchResults(0))
End If
End If
End If
Return lFound
Cursor.Current = Cursors.Default
End Function
Private Sub FocusSearchResult(ByVal res As PDFLibNet.PDFSearchResult)
Dim objPanel As Panel = Panel1
Dim objPictureBox As PictureBox = FindPictureBox("SinglePicBox")
Dim dr As Point = objPanel.AutoScrollPosition
Dim XPercentage As Single = objPictureBox.Width / mPDFDoc.PageWidth
Dim YPercentage As Single = objPictureBox.Height / mPDFDoc.PageHeight
Dim WidthOffset As Integer = (objPanel.HorizontalScroll.Maximum - (mPDFDoc.PageWidth * YPercentage)) / 2
Dim HeightOffset As Integer = (objPanel.VerticalScroll.Maximum - objPictureBox.Height) / 2
If (mPDFDoc.PageWidth * XPercentage) > objPanel.Width Then
dr.X = (res.Position.Left * YPercentage)
If WidthOffset > 1 Then
dr.X += WidthOffset
End If
End If
If (mPDFDoc.PageHeight * YPercentage) > objPanel.Height Then
dr.Y = res.Position.Top * YPercentage
If HeightOffset > 1 Then
dr.Y += HeightOffset
End If
End If
objPanel.AutoScrollPosition = dr
End Sub
#End Region
#Region "ITextSharp specific events"
Private Sub ItextSharp_NodeMouseClick(ByVal sender As Object, ByVal e As TreeNodeMouseClickEventArgs)
Dim item As iTextOutline = CType(e.Node.Tag, iTextOutline)
If item.Page <> "" Then
mCurrentPageNumber = Regex.Replace(item.Page, "(^\d+).+$", "$1")
DisplayCurrentPage()
End If
End Sub
#End Region
#Region "Panning the image with left mouse click held down"
Private Sub picImage_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
'Capture the initial point
Cursor = Cursors.Hand
m_PanStartPoint = New Point(e.X, e.Y)
End Sub
Private Sub picImage_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
'Capture the initial point
Cursor = Cursors.Default
End Sub
Private Sub picImage_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
'Verify Left Button is pressed while the mouse is moving
If e.Button = Windows.Forms.MouseButtons.Left Then
'Here we get the change in coordinates.
Dim DeltaX As Integer = (m_PanStartPoint.X - e.X)
Dim DeltaY As Integer = (m_PanStartPoint.Y - e.Y)
'Then we set the new autoscroll position.
'ALWAYS pass positive integers to the panels autoScrollPosition method
sender.Parent.AutoScrollPosition = New Drawing.Point((DeltaX - sender.Parent.AutoScrollPosition.X), (DeltaY - sender.Parent.AutoScrollPosition.Y))
End If
End Sub
'Private Sub MouseWheel(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseWheel
' Dim iClicks As Integer = e.Delta
' If iClicks > 0 Then
' ImageUtil.PictureBoxZoomOut(PictureBox1)
' Else
' ImageUtil.PictureBoxZoomIn(PictureBox1)
' End If
' ShowCurrentScalePercentage()
'End Sub
#End Region
End Class

View File

@@ -0,0 +1,133 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<Global.System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1726")> _
Partial Class Password
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
Friend WithEvents LogoPictureBox As System.Windows.Forms.PictureBox
Friend WithEvents UsernameLabel As System.Windows.Forms.Label
Friend WithEvents UsernameTextBox As System.Windows.Forms.TextBox
Friend WithEvents OK As System.Windows.Forms.Button
Friend WithEvents Cancel As System.Windows.Forms.Button
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Password))
Me.LogoPictureBox = New System.Windows.Forms.PictureBox
Me.UsernameLabel = New System.Windows.Forms.Label
Me.UsernameTextBox = New System.Windows.Forms.TextBox
Me.OK = New System.Windows.Forms.Button
Me.Cancel = New System.Windows.Forms.Button
Me.OwnerTextBox = New System.Windows.Forms.TextBox
Me.Label1 = New System.Windows.Forms.Label
CType(Me.LogoPictureBox, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'LogoPictureBox
'
Me.LogoPictureBox.Image = CType(resources.GetObject("LogoPictureBox.Image"), System.Drawing.Image)
Me.LogoPictureBox.Location = New System.Drawing.Point(0, 3)
Me.LogoPictureBox.Name = "LogoPictureBox"
Me.LogoPictureBox.Size = New System.Drawing.Size(165, 144)
Me.LogoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom
Me.LogoPictureBox.TabIndex = 0
Me.LogoPictureBox.TabStop = False
'
'UsernameLabel
'
Me.UsernameLabel.Location = New System.Drawing.Point(171, 9)
Me.UsernameLabel.Name = "UsernameLabel"
Me.UsernameLabel.Size = New System.Drawing.Size(220, 23)
Me.UsernameLabel.TabIndex = 0
Me.UsernameLabel.Text = "User Password"
Me.UsernameLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'UsernameTextBox
'
Me.UsernameTextBox.Location = New System.Drawing.Point(171, 35)
Me.UsernameTextBox.Name = "UsernameTextBox"
Me.UsernameTextBox.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42)
Me.UsernameTextBox.Size = New System.Drawing.Size(220, 20)
Me.UsernameTextBox.TabIndex = 1
'
'OK
'
Me.OK.DialogResult = System.Windows.Forms.DialogResult.OK
Me.OK.Location = New System.Drawing.Point(297, 113)
Me.OK.Name = "OK"
Me.OK.Size = New System.Drawing.Size(94, 23)
Me.OK.TabIndex = 4
Me.OK.Text = "&OK"
'
'Cancel
'
Me.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Cancel.Location = New System.Drawing.Point(197, 113)
Me.Cancel.Name = "Cancel"
Me.Cancel.Size = New System.Drawing.Size(94, 23)
Me.Cancel.TabIndex = 5
Me.Cancel.Text = "&Cancel"
'
'OwnerTextBox
'
Me.OwnerTextBox.Location = New System.Drawing.Point(171, 84)
Me.OwnerTextBox.Name = "OwnerTextBox"
Me.OwnerTextBox.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42)
Me.OwnerTextBox.Size = New System.Drawing.Size(220, 20)
Me.OwnerTextBox.TabIndex = 7
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(171, 58)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(220, 23)
Me.Label1.TabIndex = 6
Me.Label1.Text = "Owner Password"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'Password
'
Me.AcceptButton = Me.OK
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.Cancel
Me.ClientSize = New System.Drawing.Size(401, 143)
Me.Controls.Add(Me.OwnerTextBox)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.Cancel)
Me.Controls.Add(Me.OK)
Me.Controls.Add(Me.UsernameTextBox)
Me.Controls.Add(Me.UsernameLabel)
Me.Controls.Add(Me.LogoPictureBox)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "Password"
Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "Please Enter the Password"
CType(Me.LogoPictureBox, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents OwnerTextBox As System.Windows.Forms.TextBox
Friend WithEvents Label1 As System.Windows.Forms.Label
End Class

View File

@@ -0,0 +1,528 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="LogoPictureBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAXepJREFUeF7tnQd4
FNXXxj/pnUAQKRYsWBAVhb+K2HvvHQWlCNKbha5gAbGgIIq9d5FiF+k91ABJ6L2XNJLQwvned3bu5u5k
ZksIkF1vnud9dnazu8nOzvndc84999zjROT/zE/+M3DcccfF8mkJ58PF/IVhrn1c4jwJRvnPQZRbPw1c
VzHcd6o4Hgsm5/Od7xnlp8hc+xYAjfG7AzDKrm43Y1fGXQKfhSppqxRulUrj2E3q9+o1vFXvw/fV4aD/
7ag6bebaNwDwBGAUXMnK8JQx0jCdhk7jLgOVtVUOt+VtVcCtl9RzeMvX8PV8H4rvSUAoKCjQqP9D/V9F
/hQaABgARBsAghk9jVIZuzJ0GnilcS0rN/mrTeXbf29d6Y55XeMGJXSJG5zQOW7wnE6VB8+mOlYePKtD
pcFT2lXq/UuzCneObl7hjjduL9sAr60CxUGV+T5QRRsaCgxeQIgKGBgAGABEAwCCGb0a4S2D/7ZZpXNn
dqny6KJnqw5K6VV12oreVdet6l1VVkIrekE9q8jy56vIMuq5KpLybJwkU8/ESVKPyrKU6l5ZlnSjKsni
rpVkXsdKS+a0r/j75KcqDPnm4XJ3t2hU6jT8rao2GBQUCATlJTi9A8KgSHoFBgAGAEUZAG6GT7dbjfTl
Xr69Qu1Z3ao+uqx3/Ner+1Vbt7Z/vKzpFy+r+/q0qk9VOVwAJHapJImdK8mizhVlYSeoY0WZ067ikomt
yn/w7p1lr8X/U80GAr0EeghOGDAs0fMGRQYGBgAGAEURAE7DV3E9R3uOsuUXPFu17Yo+8b+ue6GaKK3t
X028ALDprbNk45tnyY6PL5ZdX1wuOy01kZ2fN5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ZOcgRnglClvRSNHy6/Ewcxv0XjN94AMYDiFUP
wMsTUOXDDAlo5HTxafAUocBRn1WFBEVMxvxOSkY6Wsbi840HEJsegA4BZ3KQxs1ZArr4hAHFYxo+S4sJ
Chb5MISImYSf0/iNB2A8gFj3ANwgoPICXEdAQycMKB7zMRq+WtUX08ZvAGAA8F8BgA4CGrXKDdDQdREO
+qgf9fP8bqO+/lgsuvSRfiYTAsR2COC0ATVVqMICBQQ12uu/D2U/Uf/7SI0lFp9vAPDfAoCb0cb8SO9F
qlg06Eg/kwGAAUDUj+QF/QCRGkssPt8AwACgoPYT9a+LRYOO9DMZAERxS+dIv2zz/Njb3PNwv1MDAAMA
cw38h68B8+X/h7/8wx09zOuj36MwADAAMNfAf/ga+H+S62CUUQxsUwAAAABJRU5ErkJggg==
</value>
</data>
</root>

View File

@@ -0,0 +1,22 @@
Public Class Password
Public UserPassword As String = ""
Public OwnerPassword As String = ""
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
Me.Close()
End Sub
Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
Me.Close()
End Sub
Private Sub UsernameTextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles UsernameTextBox.TextChanged
UserPassword = UsernameTextBox.Text
End Sub
Private Sub OwnerTextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles OwnerTextBox.TextChanged
OwnerPassword = OwnerTextBox.Text
End Sub
End Class

View File

@@ -0,0 +1,435 @@
Imports System.Drawing.Printing
Imports System.Runtime.InteropServices
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Imports System.IO
Public Class PrinterUtil
Private WithEvents mPrintDocument As PrintDocument
Private mFileName As String
Private mStartPage As Integer
Private mEndPage As Integer
Private mCurrentPage As Integer
Private mPassword As String
Public Shared Function ListAllInstalledPrinters() As List(Of String)
ListAllInstalledPrinters = New List(Of String)
For Each InstalledPrinter As String In _
PrinterSettings.InstalledPrinters
ListAllInstalledPrinters.Add(InstalledPrinter)
Next InstalledPrinter
End Function
Public Shared Function CreateCustomPrintToFilePort() As String
Dim TempString As String = Format(Now, "yyyyMMDDhhmmssfff")
Dim p1 As PrinterInterOp.PORT_INFO_1
p1.pPortName = System.IO.Path.GetTempPath & "\" & TempString & ".prn"
CreateCustomPrintToFilePort = p1.pPortName
PrinterInterOp.AddPortEx(Nothing, 1, p1, "Local Port")
End Function
Public Shared Function CreateNewTempPrinter(ByVal PrinterName As String, ByVal PortName As String, ByVal PrintDriverName As String) As Integer
Dim PrintInterop As New PrinterInterOp
CreateNewTempPrinter = PrintInterop.AddPrinter(PrinterName, PortName, PrintDriverName, "WinPrint")
End Function
Public Shared Sub SendFileToPrinter(ByVal PrinterName As String, ByVal FileName As String)
Dim RP As New RawPrinterHelper
RP.SendFileToPrinter(PrinterName, FileName)
End Sub
Public Shared Sub PrintImageToPrinter(ByRef myFileName As String, ByVal myPrinterSettings As PrinterSettings, Optional ByVal password As String = "")
Dim PrintUtil As New PrinterUtil
PrintUtil.mPrintDocument = New PrintDocument
PrintUtil.mFileName = myFileName
PrintUtil.mPrintDocument.PrinterSettings.PrinterName = myPrinterSettings.PrinterName
Dim StandardPrint As New StandardPrintController
PrintUtil.mPrintDocument.PrintController = StandardPrint
PrintUtil.mPrintDocument.PrinterSettings = myPrinterSettings
PrintUtil.mStartPage = myPrinterSettings.FromPage
PrintUtil.mEndPage = myPrinterSettings.ToPage
PrintUtil.mCurrentPage = PrintUtil.mStartPage
PrintUtil.mPassword = password
Cursor.Current = Cursors.WaitCursor
PrintUtil.mPrintDocument.Print()
PrintUtil = Nothing
GC.Collect()
Cursor.Current = Cursors.Default
End Sub
Public Shared Sub PrintPDFDirectlyToPrinter(ByVal FileName As String)
Dim PD As New PrintDialog
If PD.ShowDialog = DialogResult.OK Then
Dim RP As New RawPrinterHelper
RP.SendFileToPrinter(PD.PrinterSettings.PrinterName, FileName)
End If
End Sub
Public Shared Sub PrintImagesToPrinter(ByVal FileName As String, Optional ByVal password As String = "")
Dim PD As New PrintDialog
Dim PageCount As Integer = PDFView.ImageUtil.GetImageFrameCount(FileName)
PD.AllowPrintToFile = True
PD.AllowSomePages = True
PD.PrinterSettings.FromPage = 1
PD.PrinterSettings.ToPage = PageCount
PD.PrinterSettings.MaximumPage = PageCount
PD.PrinterSettings.MinimumPage = 1
If PD.ShowDialog = DialogResult.OK Then
Dim BeginningPage As Integer = 1
Dim EndingPage As Integer = PageCount
If PD.PrinterSettings.PrintRange = PrintRange.SomePages Then
BeginningPage = PD.PrinterSettings.FromPage
EndingPage = PD.PrinterSettings.ToPage
End If
PrintImageToPrinter(FileName, PD.PrinterSettings, password)
End If
End Sub
Private Sub PrintDocument1_PrintPage(ByVal sender As Object, _
ByVal e As PrintPageEventArgs) Handles mPrintDocument.PrintPage
Dim RenderDPI As Integer = 300 'Set to 600 if this resolution is too low (speed vs. time)
Dim image As System.Drawing.Image = ImageUtil.GetImagePageFromFileForPrint(mFileName, mCurrentPage, RenderDPI, mPassword)
'Comment out if you do not want Auto-Rotate
If (image.Height > image.Width And e.Graphics.VisibleClipBounds.Width > e.Graphics.VisibleClipBounds.Height) _
Or (image.Width > image.Height And e.Graphics.VisibleClipBounds.Height > e.Graphics.VisibleClipBounds.Width) Then
image.RotateFlip(RotateFlipType.Rotate270FlipNone)
End If
Dim ScalePercentage As Single
Dim XMaxPixels As Integer = (e.Graphics.VisibleClipBounds.Width / 100) * image.HorizontalResolution
Dim YMaxPixels As Integer = (e.Graphics.VisibleClipBounds.Height / 100) * image.VerticalResolution
Dim XFactor As Single = XMaxPixels / image.Width
Dim YFactor As Single = YMaxPixels / image.Height
Dim OptimalDPI As Integer
If YFactor > XFactor Then
ScalePercentage = XFactor
OptimalDPI = RenderDPI * XFactor
Else
ScalePercentage = YFactor
OptimalDPI = RenderDPI * YFactor
End If
If ScalePercentage < 0.75F Then 'Re-render the image to create a smaller print file and save printer processing time
image = ImageUtil.GetImagePageFromFileForPrint(mFileName, mCurrentPage, OptimalDPI, mPassword)
If (image.Height > image.Width And e.Graphics.VisibleClipBounds.Width > e.Graphics.VisibleClipBounds.Height) _
Or (image.Width > image.Height And e.Graphics.VisibleClipBounds.Height > e.Graphics.VisibleClipBounds.Width) Then
image.RotateFlip(RotateFlipType.Rotate270FlipNone)
End If
End If
e.Graphics.ScaleTransform(ScalePercentage, ScalePercentage)
e.Graphics.DrawImage(image, 0, 0)
If mCurrentPage >= mEndPage Then
e.HasMorePages = False
Else
e.HasMorePages = True
End If
image.Dispose()
mCurrentPage += 1
End Sub
End Class
Friend Class PrinterInterOp
Public Structure PORT_INFO_1
Dim pPortName As String
End Structure
Structure PrinterDefaults
Public pDataType As String
Public pDevMode As Int32
Public permissions As Int32
End Structure
Public Function AddPrinter(ByVal psPrinterName As String, ByVal psPortName As String, _
ByVal psDriverName As String, _
ByVal psPrintProcessor As String) As IntPtr
Dim pi2 As New PRINTER_INFO_2
Dim iError As Integer
With pi2
.pPrinterName = psPrinterName
.pPortName = psPortName
.pDriverName = psDriverName
.pPrintProcessor = psPrintProcessor
End With
Dim rtn As Int32
rtn = AddPrinter("", 2, pi2)
If rtn = 0 Then
iError = Marshal.GetLastWin32Error()
Select Case iError
Case 1796
MsgBox("The specified port is unknown")
Exit Select
Case 1797
MsgBox("Printer driver is unknown or not loaded")
Exit Select
Case 1798
MsgBox("The print processor is unknown")
Exit Select
Case 1801
MsgBox("Printer name is invalid")
Exit Select
Case 1802
MsgBox("Printer name already exists")
Exit Select
Case Else
MsgBox("An error occured. Errorcode: " & iError)
Exit Select
End Select
Else
MsgBox("Printer was created successfully")
End If
ClosePrinter(rtn)
Return rtn
End Function
Public Sub RemovePrinter(ByVal PrinterName As String)
Dim hPrinter As IntPtr
Dim PrinterDefs As New PrinterDefaults
With PrinterDefs
.pDevMode = 0&
.permissions = PRINTER_ALL_ACCESS
End With
If OpenPrinter(PrinterName, hPrinter, PrinterDefs) <> 0 Then
If hPrinter <> 0 Then
If DeletePrinter(hPrinter) <> 0 Then
MsgBox("Printer deleted")
Else
MsgBox("Error :" & Err.LastDllError)
End If 'DeletePrinter
End If 'hPrinter
ClosePrinter(hPrinter)
Else
MsgBox("Error :" & Err.LastDllError)
End If 'OpenPrinter
End Sub
Public Declare Function AddPortEx Lib "winspool.drv" Alias "AddPortExA" _
(ByVal pName As String, ByVal pLevel As Integer, _
ByRef lpBuffer As PORT_INFO_1, ByVal pMonitorName As String) As Integer
Public Declare Function DeletePort Lib "winspool.drv" _
(ByVal pName As String, ByVal pLevel As Integer, _
ByVal pMonitorName As String) As Integer
Public Declare Auto Function OpenPrinter Lib "winspool.drv" _
(ByVal pPrinterName As String, _
ByRef phPrinter As IntPtr, _
ByVal pDefault As PrinterDefaults) As Int32
Public Declare Auto Function ResetPrinter Lib "winspool.drv" _
(ByRef phPrinter As IntPtr, _
ByVal pDefault As PrinterDefaults) As Int32
Public Declare Function DeletePrinter Lib "winspool.drv" _
(ByVal hPrinter As IntPtr) As Int32
Public Declare Function ClosePrinter Lib "winspool.drv" _
(ByVal hPrinter As IntPtr) As Int32
Private Declare Function AddPrinter Lib "winspool.drv" _
Alias "AddPrinterA" _
(ByVal pServerName As String, _
ByVal Level As Int32, _
ByVal pPrinter As PRINTER_INFO_2) As Int32
Public Declare Function GetPrinter Lib "winspool.drv" Alias "GetPrinterW" _
(ByVal hPrinter As IntPtr, ByVal Level As Integer, ByVal pPrinter As IntPtr, _
ByVal cbBuf As Integer, ByRef pcbNeeded As Integer) As Integer
Public Const PRINTER_ACCESS_ADMINISTER As Int32 = &H4
Public Const STANDARD_RIGHTS_REQUIRED As Int32 = &HF0000
Public Const PRINTER_ACCESS_USE As Int32 = &H8
Public Const PRINTER_ALL_ACCESS As Int32 = _
STANDARD_RIGHTS_REQUIRED Or _
PRINTER_ACCESS_USE Or _
PRINTER_ACCESS_ADMINISTER
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto), System.Security.SuppressUnmanagedCodeSecurity()> _
Friend Class PRINTER_INFO_2
<MarshalAs(UnmanagedType.LPStr)> Public pServerName As String
<MarshalAs(UnmanagedType.LPStr)> Public pPrinterName As String
<MarshalAs(UnmanagedType.LPStr)> Public pShareName As String
<MarshalAs(UnmanagedType.LPStr)> Public pPortName As String
<MarshalAs(UnmanagedType.LPStr)> Public pDriverName As String
<MarshalAs(UnmanagedType.LPStr)> Public pComment As String
<MarshalAs(UnmanagedType.LPStr)> Public pLocation As String
<MarshalAs(UnmanagedType.U4)> Public pDevMode As Int32
<MarshalAs(UnmanagedType.LPStr)> Public pSepFile As String
<MarshalAs(UnmanagedType.LPStr)> Public pPrintProcessor As String
<MarshalAs(UnmanagedType.LPStr)> Public pDatatype As String
<MarshalAs(UnmanagedType.LPStr)> Public pParameters As String
<MarshalAs(UnmanagedType.U4)> Public pSecurityDescriptor As Int32
Public Attributes As UInteger
Public Priority As UInteger
Public DefaultPriority As UInteger
Public StartTime As UInteger
Public UntilTime As UInteger
Public Status As UInteger
Public cJobs As UInteger
Public AveragePPM As UInteger
Public Sub New(ByVal hPrinter As IntPtr)
Dim BytesWritten As Int32 = 0
Dim ptBuf As IntPtr
ptBuf = Marshal.AllocHGlobal(1)
Dim PI As New PrinterInterOp
If Not GetPrinter(hPrinter, 2, ptBuf, 1, BytesWritten) Then
If BytesWritten > 0 Then
'\\ Free the buffer allocated
Marshal.FreeHGlobal(ptBuf)
ptBuf = Marshal.AllocHGlobal(BytesWritten)
If GetPrinter(hPrinter, 2, ptBuf, BytesWritten, BytesWritten) Then
Marshal.PtrToStructure(ptBuf, Me)
'\\ Fill any missing members
If pServerName Is Nothing Then
pServerName = ""
End If
Else
Throw New Win32Exception()
End If
'\\ Free this buffer again
Marshal.FreeHGlobal(ptBuf)
Else
Throw New Win32Exception()
End If
Else
Throw New Win32Exception()
End If
End Sub
Public Sub New()
End Sub
End Class
End Class
Friend Class RawPrinterHelper
' Structure and API declarions:
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> _
Public Class DOCINFOA
<MarshalAs(UnmanagedType.LPStr)> _
Public pDocName As String
<MarshalAs(UnmanagedType.LPStr)> _
Public pOutputFile As String
<MarshalAs(UnmanagedType.LPStr)> _
Public pDataType As String
End Class
<DllImport("winspool.Drv", EntryPoint:="OpenPrinterA", SetLastError:=True, CharSet:=CharSet.Ansi, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function OpenPrinter(<MarshalAs(UnmanagedType.LPStr)> ByVal szPrinter As String, ByRef hPrinter As IntPtr, ByVal pd As IntPtr) As Boolean
End Function
<DllImport("winspool.Drv", EntryPoint:="ClosePrinter", SetLastError:=True, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function ClosePrinter(ByVal hPrinter As IntPtr) As Boolean
End Function
<DllImport("winspool.Drv", EntryPoint:="StartDocPrinterA", SetLastError:=True, CharSet:=CharSet.Ansi, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function StartDocPrinter(ByVal hPrinter As IntPtr, ByVal level As Int32, <[In](), MarshalAs(UnmanagedType.LPStruct)> ByVal di As DOCINFOA) As Boolean
End Function
<DllImport("winspool.Drv", EntryPoint:="EndDocPrinter", SetLastError:=True, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function EndDocPrinter(ByVal hPrinter As IntPtr) As Boolean
End Function
<DllImport("winspool.Drv", EntryPoint:="StartPagePrinter", SetLastError:=True, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function StartPagePrinter(ByVal hPrinter As IntPtr) As Boolean
End Function
<DllImport("winspool.Drv", EntryPoint:="EndPagePrinter", SetLastError:=True, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function EndPagePrinter(ByVal hPrinter As IntPtr) As Boolean
End Function
<DllImport("winspool.Drv", EntryPoint:="WritePrinter", SetLastError:=True, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function WritePrinter(ByVal hPrinter As IntPtr, ByVal pBytes As IntPtr, ByVal dwCount As Int32, ByRef dwWritten As Int32) As Boolean
End Function
' SendBytesToPrinter()
' When the function is given a printer name and an unmanaged array
' of bytes, the function sends those bytes to the print queue.
' Returns true on success, false on failure.
Public Function SendBytesToPrinter(ByVal szPrinterName As String, ByVal pBytes As IntPtr, ByVal dwCount As Int32) As Boolean
Dim dwError As Int32 = 0, dwWritten As Int32 = 0
Dim hPrinter As New IntPtr(0)
Dim di As New DOCINFOA()
Dim bSuccess As Boolean = False
' Assume failure unless you specifically succeed.
di.pDocName = "My VB.NET RAW Document"
di.pDataType = "RAW"
' Open the printer.
If OpenPrinter(szPrinterName.Normalize(), hPrinter, IntPtr.Zero) Then
' Start a document.
If StartDocPrinter(hPrinter, 1, di) Then
' Start a page.
If StartPagePrinter(hPrinter) Then
' Write your bytes.
bSuccess = WritePrinter(hPrinter, pBytes, dwCount, dwWritten)
EndPagePrinter(hPrinter)
End If
EndDocPrinter(hPrinter)
End If
ClosePrinter(hPrinter)
End If
' If you did not succeed, GetLastError may give more information
' about why not.
If bSuccess = False Then
dwError = Marshal.GetLastWin32Error()
End If
Return bSuccess
End Function
Public Function SendFileToPrinter(ByVal szPrinterName As String, ByVal szFileName As String) As Boolean
' Open the file.
Dim fs As New FileStream(szFileName, FileMode.Open)
' Create a BinaryReader on the file.
Dim br As New BinaryReader(fs)
' Dim an array of bytes big enough to hold the file's contents.
Dim bytes As [Byte]() = New [Byte](fs.Length - 1) {}
Dim bSuccess As Boolean = False
' Your unmanaged pointer.
Dim pUnmanagedBytes As New IntPtr(0)
Dim nLength As Integer
nLength = Convert.ToInt32(fs.Length)
' Read the contents of the file into the array.
bytes = br.ReadBytes(nLength)
' Allocate some unmanaged memory for those bytes.
pUnmanagedBytes = Marshal.AllocCoTaskMem(nLength)
' Copy the managed byte array into the unmanaged array.
Marshal.Copy(bytes, 0, pUnmanagedBytes, nLength)
' Send the unmanaged bytes to the printer.
bSuccess = SendBytesToPrinter(szPrinterName, pUnmanagedBytes, nLength)
' Free the unmanaged memory that you allocated earlier.
Marshal.FreeCoTaskMem(pUnmanagedBytes)
fs.Close()
br.Close()
Return bSuccess
End Function
Public Function SendStringToPrinter(ByVal szPrinterName As String, ByVal szString As String) As Boolean
Dim pBytes As IntPtr
Dim dwCount As Int32
' How many characters are in the string?
dwCount = szString.Length
' Assume that the printer is expecting ANSI text, and then convert
' the string to ANSI text.
pBytes = Marshal.StringToCoTaskMemAnsi(szString)
' Send the converted ANSI string to the printer.
SendBytesToPrinter(szPrinterName, pBytes, dwCount)
Marshal.FreeCoTaskMem(pBytes)
Return True
End Function
End Class

View File

@@ -0,0 +1,81 @@
Imports System.Drawing
Imports System.Windows.Forms
Public Class TesseractOCR
Public Shared Function OCRImage(ByVal bm As System.Drawing.Image, ByVal language As String) As String
OCRImage = ""
Dim oOCR As New tessnet2.Tesseract
oOCR.Init(Nothing, language, False)
Dim WordList As New List(Of tessnet2.Word)
WordList = oOCR.doOCR(ImageUtil.MakeGrayscale(bm), Rectangle.Empty)
Dim LineCount As Integer = tessnet2.Tesseract.LineCount(WordList)
For i As Integer = 0 To LineCount - 1
OCRImage &= tessnet2.Tesseract.GetLineText(WordList, i) & vbCrLf
Next
oOCR.Dispose()
''Debug
'OCRPaintWordBorders(bm, WordList)
End Function
Public Shared Sub OCRPaintWordBorders(ByRef img As System.Drawing.Image, ByVal WordList As List(Of tessnet2.Word))
If WordList IsNot Nothing Then
Dim g As Graphics = Graphics.FromImage(img)
g.DrawImage(img, 0, 0)
For Each word As tessnet2.Word In WordList
Dim pen As Pen = New Pen(Color.FromArgb(255, 128, CInt(word.Confidence)))
g.DrawRectangle(pen, word.Left, word.Top, word.Right - word.Left, word.Bottom - word.Top)
'For Each c As tessnet2.Character In word.CharList
' e.Graphics.DrawRectangle(Pens.BlueViolet, c.Left + panel2.AutoScrollPosition.X, c.Top + panel2.AutoScrollPosition.Y, c.Right - c.Left, c.Bottom - c.Top)
'Next
Next
g.Dispose()
End If
End Sub
Public Shared Function GetPDFIndex(ByRef imgOCR As System.Drawing.Image, ByVal language As String) As List(Of PDFWordIndex)
GetPDFIndex = New List(Of PDFWordIndex)
Dim oOCR As New tessnet2.Tesseract
oOCR.Init(Nothing, language, False)
Dim WordList As New List(Of tessnet2.Word)
WordList = oOCR.doOCR(imgOCR, Rectangle.Empty)
If WordList IsNot Nothing Then
For Each word As tessnet2.Word In WordList
Dim pdfWordIndex As New PDFWordIndex
pdfWordIndex.X = word.Left
pdfWordIndex.Y = word.Top
pdfWordIndex.Width = word.Right - word.Left
pdfWordIndex.Height = word.Bottom - word.Top
pdfWordIndex.FontSize = word.PointSize
pdfWordIndex.Text = word.Text
GetPDFIndex.Add(pdfWordIndex)
Next
End If
End Function
Public Structure Language
Dim i As Integer
Shared English As String = "eng"
Shared Spanish As String = "spa"
Shared German As String = "deu"
Shared Italian As String = "ita"
Shared French As String = "fra"
Shared Dutch As String = "nld"
Shared Portuguese As String = "por"
Shared Vietnamese As String = "vie"
Shared Basque As String = "eus"
Shared Fraktur As String = "deu-f"
End Structure
End Class
Public Class PDFWordIndex
Public X As Integer
Public Y As Integer
Public Width As Integer
Public Height As Integer
Public FontSize As Integer
Public Text As String
End Class

View File

@@ -0,0 +1,303 @@
Imports iTextSharp.text.pdf
Imports iTextSharp.text
Imports System.IO
Imports System.Text
Imports System.Xml
Imports System.Text.RegularExpressions
Imports System.Windows.Forms
Imports System.Drawing.Imaging
Public Class iTextSharpUtil
Public Shared mBookmarkList As New ArrayList
Public Shared Function GetPDFPageCount(ByVal filepath As String, Optional ByVal userPassword As String = "") As Integer
Dim oPdfReader As PdfReader
If userPassword <> "" Then
Dim encoding As New System.Text.ASCIIEncoding()
oPdfReader = New PdfReader(filepath, encoding.GetBytes(userPassword))
Else
oPdfReader = New PdfReader(filepath)
End If
Dim page_count As Integer = oPdfReader.NumberOfPages
oPdfReader.Close()
Return page_count
End Function
Public Shared Function GetPDFPageSize(ByVal filepath As String, ByVal pageNumber As Integer, Optional ByVal userPassword As String = "") As Drawing.Size
Dim oPdfReader As PdfReader
If userPassword <> "" Then
Dim encoding As New System.Text.ASCIIEncoding()
oPdfReader = New PdfReader(filepath, encoding.GetBytes(userPassword))
Else
oPdfReader = New PdfReader(filepath)
End If
Dim page_count As Integer = oPdfReader.NumberOfPages
If pageNumber >= 1 And pageNumber <= page_count Then
Dim rect As iTextSharp.text.Rectangle = oPdfReader.GetPageSize(pageNumber)
GetPDFPageSize.Height = rect.Height
GetPDFPageSize.Width = rect.Width
End If
oPdfReader.Close()
End Function
Public Shared Function GetOptimalDPI(ByVal filepath As String, ByVal pageNumber As Integer, ByRef oPictureBox As PictureBox, Optional ByVal userPassword As String = "") As Integer
GetOptimalDPI = 0
Dim pageSize As Drawing.Size = GetPDFPageSize(filepath, pageNumber, userPassword)
If pageSize.Width > 0 And pageSize.Height > 0 Then
Dim picHeight As Integer = oPictureBox.Height
Dim picWidth As Integer = oPictureBox.Width
Dim dummyPicBox As New PictureBox
dummyPicBox.Size = oPictureBox.Size
If (picWidth > picHeight And pageSize.Width < pageSize.Height) Or (picWidth < picHeight And pageSize.Width > pageSize.Height) Then
dummyPicBox.Width = picHeight
dummyPicBox.Height = picWidth
End If
Dim HScale As Single = dummyPicBox.Width / pageSize.Width
Dim VScale As Single = dummyPicBox.Height / pageSize.Height
dummyPicBox.Dispose()
If HScale < VScale Then
GetOptimalDPI = Math.Floor(72 * HScale)
Else
GetOptimalDPI = Math.Floor(72 * VScale)
End If
End If
End Function
Public Shared Sub FillTreeRecursive(ByVal arList As ArrayList, ByVal treeNodes As TreeNode)
For Each item As Object In arList
Dim tn As New TreeNode(item("Title"))
Dim ol As iTextOutline
ol.Title = item("Title")
ol.Action = item("Action")
ol.Named = item("Named")
ol.Page = item("Page")
tn.Tag = ol
treeNodes.Nodes.Add(tn)
If Not Nothing Is item("Kids") Then
FillTreeRecursive(item("Kids"), tn)
End If
Next
End Sub
Public Shared Function BuildBookmarkTreeFromPDF(ByVal FileName As String, ByVal TreeNodes As TreeNodeCollection, Optional ByVal userPassword As String = "") As Boolean
TreeNodes.Clear()
Dim oPdfReader As PdfReader
If userPassword <> "" Then
Dim encoding As New System.Text.ASCIIEncoding()
oPdfReader = New PdfReader(FileName, encoding.GetBytes(userPassword))
Else
oPdfReader = New PdfReader(FileName)
End If
Dim pageCount As Integer = oPdfReader.NumberOfPages
Dim arList As ArrayList = New ArrayList()
arList = SimpleBookmark.GetBookmark(oPdfReader)
oPdfReader.Close()
If Nothing Is arList Then
Return False
End If
Dim CurrentNode As New TreeNode
CurrentNode = TreeNodes.Add("Bookmarks")
FillTreeRecursive(arList, CurrentNode)
Return True
End Function
'Dim format As String = "<li><a href=""javascript:changeImage('images/page{0}.png')"">{1}</a></li>"
Public Shared Function BuildHTMLBookmarks(ByVal FileName As String, Optional ByVal userPassword As String = "") As String
Dim oPdfReader As PdfReader
If userPassword <> "" Then
Dim encoding As New System.Text.ASCIIEncoding()
oPdfReader = New PdfReader(FileName, encoding.GetBytes(userPassword))
Else
oPdfReader = New PdfReader(FileName)
End If
Dim numberOfPages As Integer = oPdfReader.NumberOfPages
Dim arList As ArrayList = New ArrayList()
arList = SimpleBookmark.GetBookmark(oPdfReader)
oPdfReader.Close()
If Nothing Is arList Then
BuildHTMLBookmarks = "<ul>"
For i As Integer = 1 To numberOfPages
BuildHTMLBookmarks &= "<li><a href=""javascript:changeImage('images/page" & i & ".png')"">Page " & i & "</a></li>"
Next
BuildHTMLBookmarks &= "</ul>"
Exit Function
Else
BuildHTMLBookmarks = ""
fillRecursiveHTMLTree(arList, BuildHTMLBookmarks)
Exit Function
End If
End Function
Public Shared Sub fillRecursiveHTMLTree(ByVal arList As ArrayList, ByRef strHtml As String)
strHtml &= "<ul>"
For Each item As Object In arList
Dim i As String = Regex.Replace(item("Page"), "(^\d+).+$", "$1")
strHtml &= "<li><a href=""javascript:changeImage('images/page" & i & ".png')"">" & Web.HttpUtility.HtmlEncode(item("Title")) & "</a></li>"
If Not Nothing Is item("Kids") Then
fillRecursiveHTMLTree(item("Kids"), strHtml)
End If
Next
strHtml &= "</ul>"
End Sub
Public Shared Function GraphicListToPDF(ByVal psFilenames As String() _
, ByVal outputFileName As String _
, ByVal psPageSize As iTextSharp.text.Rectangle _
, Optional ByVal language As String = "" _
, Optional ByVal StartPage As Integer = 0 _
, Optional ByVal EndPage As Integer = 0 _
, Optional ByVal UserPassword As String = "" _
, Optional ByVal OwnerPassword As String = "")
Dim StatusDialog As New ImportProgress
StatusDialog.TopMost = True
StatusDialog.Show()
Dim document As iTextSharp.text.Document
document = New Document(psPageSize, 0, 0, 0, 0)
Try
Dim writer As PdfWriter = PdfWriter.GetInstance(document, New FileStream(outputFileName, FileMode.Create))
If UserPassword <> "" Or OwnerPassword <> "" Then
writer.SetEncryption(PdfWriter.STRENGTH128BITS, UserPassword, OwnerPassword, PdfWriter.AllowCopy Or PdfWriter.AllowPrinting)
End If
document.Open()
Dim cb As PdfContentByte = writer.DirectContent
Dim fileNumber As Integer = 0
For Each psFileName As String In psFilenames
Dim ProgressIncrement As Integer = 100 / psFilenames.Length
fileNumber += 1
StatusDialog.UpdateProgress("Processing file " & fileNumber & "/" & psFilenames.Length, 0)
Application.DoEvents()
Dim bm As New System.Drawing.Bitmap(psFileName)
Dim total As Integer = bm.GetFrameCount(FrameDimension.Page)
If StartPage = 0 And EndPage = 0 Then
StartPage = 1
EndPage = total
End If
For k As Integer = StartPage To EndPage
StatusDialog.UpdateProgress("Processing page " & k & "/" & EndPage & " for file " & fileNumber & "/" & psFilenames.Length, ProgressIncrement / EndPage)
Application.DoEvents()
bm.SelectActiveFrame(FrameDimension.Page, k - 1)
'Auto Rotate the page if needed
If (psPageSize.Height > psPageSize.Width And bm.Width > bm.Height) _
Or (psPageSize.Width > psPageSize.Height And bm.Height > bm.Width) Then
document.SetPageSize(psPageSize.Rotate)
Else
document.SetPageSize(psPageSize)
End If
document.NewPage()
Dim img As iTextSharp.text.Image
img = iTextSharp.text.Image.GetInstance(bm, bm.RawFormat)
Dim Xpercent As Single = document.PageSize.Width / img.Width
Dim Ypercent As Single = document.PageSize.Height / img.Height
Dim ScalePercentage As Single
If Xpercent < Ypercent Then
ScalePercentage = Xpercent
Else
ScalePercentage = Ypercent
End If
img.ScalePercent(ScalePercentage * 100)
Dim xPos As Integer = (document.PageSize.Width - (img.Width * ScalePercentage)) / 2
Dim yPos As Integer = (document.PageSize.Height - (img.Height * ScalePercentage)) / 2
img.SetAbsolutePosition(xPos, yPos)
Try
If language <> "" Then
StatusDialog.UpdateProgress("OCR reading page " & k & "/" & EndPage & " for file " & fileNumber & "/" & psFilenames.Length, 0)
Application.DoEvents()
Dim bf As BaseFont = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED)
cb.BeginText()
Dim indexList As List(Of PDFWordIndex)
indexList = TesseractOCR.GetPDFIndex(bm, language)
StatusDialog.UpdateProgress("Adding search text to page " & k & "/" & EndPage & " for file " & fileNumber & "/" & psFilenames.Length, 0)
Application.DoEvents()
For Each item As PDFWordIndex In indexList
Dim fontSize As Single = item.FontSize
Dim text As String = item.Text
cb.SetColorFill(Color.WHITE) 'make text invisible in background
'Must convert image x,y (x units per inch) to PDF x,y (72 units per inch)
'Must know PDF page size to calculate the scale factor
'Must invert Y coordinate so we go top -> bottom
Dim x As Integer = (item.X * ScalePercentage) + xPos
Dim y As Integer = (item.Y * ScalePercentage) + yPos
y = (document.PageSize.Height - y) - fontSize
'Keep adjusting the font size until the text is the same width as the word rectangle
Dim desiredWidth As Integer = Math.Ceiling(item.Width * ScalePercentage)
Dim desiredHeight As Integer = Math.Ceiling(item.Height * ScalePercentage)
Dim renderFontWidth As Integer = bf.GetWidthPoint(text, fontSize)
While renderFontWidth < desiredWidth
fontSize += 0.5F
renderFontWidth = bf.GetWidthPoint(text, fontSize)
End While
cb.SetFontAndSize(bf, fontSize)
y = y - (fontSize - item.FontSize) / 2
cb.ShowTextAlignedKerned(Element.ALIGN_JUSTIFIED_ALL, text, x, y, 0)
Next
cb.EndText()
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Try
StatusDialog.UpdateProgress("Adding image to PDF of page " & k & "/" & EndPage & " for file " & fileNumber & "/" & psFilenames.Length, 0)
Application.DoEvents()
cb.AddImage(img)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Next
bm.Dispose()
Next
document.Close()
StatusDialog.Close()
GraphicListToPDF = outputFileName
Catch de As Exception
StatusDialog.Close()
MsgBox(de.Message)
'Console.[Error].WriteLine(de.Message)
'Console.[Error].WriteLine(de.StackTrace)
GraphicListToPDF = ""
End Try
End Function
Public Shared Function IsEncrypted(ByVal pdfFileName As String) As Boolean
IsEncrypted = False
Try
Dim oPDFReader As New PdfReader(pdfFileName)
oPDFReader.Close()
Catch ex As BadPasswordException
IsEncrypted = True
End Try
End Function
Public Shared Function IsPasswordValid(ByVal pdfFileName As String, ByVal Password As String) As Boolean
IsPasswordValid = False
Try
Dim encoding As New System.Text.ASCIIEncoding()
Dim oPDFReader As New PdfReader(pdfFileName, encoding.GetBytes(Password))
oPDFReader.Close()
IsPasswordValid = True
Catch ex As BadPasswordException
'Authentication Failed
End Try
End Function
End Class
Public Structure iTextOutline
Dim Title As String
Dim Action As String
Dim Page As String
Dim Named As String
Dim Position As Drawing.Point
End Structure

View File

@@ -0,0 +1,162 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog
Me.Panel1 = New System.Windows.Forms.Panel
Me.Panel3 = New System.Windows.Forms.Panel
Me.rbGS = New System.Windows.Forms.RadioButton
Me.rbXPDF = New System.Windows.Forms.RadioButton
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.Panel2 = New System.Windows.Forms.Panel
Me.PdfViewer1 = New PDFView.PDFViewer
Me.btOCR = New System.Windows.Forms.Button
Me.Panel1.SuspendLayout()
Me.Panel3.SuspendLayout()
Me.Panel2.SuspendLayout()
Me.SuspendLayout()
'
'OpenFileDialog1
'
Me.OpenFileDialog1.FileName = "OpenFileDialog1"
'
'Panel1
'
Me.Panel1.Controls.Add(Me.btOCR)
Me.Panel1.Controls.Add(Me.Panel3)
Me.Panel1.Controls.Add(Me.TextBox1)
Me.Panel1.Controls.Add(Me.Button1)
Me.Panel1.Dock = System.Windows.Forms.DockStyle.Top
Me.Panel1.Location = New System.Drawing.Point(0, 0)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(539, 30)
Me.Panel1.TabIndex = 0
'
'Panel3
'
Me.Panel3.Controls.Add(Me.rbGS)
Me.Panel3.Controls.Add(Me.rbXPDF)
Me.Panel3.Location = New System.Drawing.Point(307, 3)
Me.Panel3.Name = "Panel3"
Me.Panel3.Size = New System.Drawing.Size(148, 23)
Me.Panel3.TabIndex = 2
'
'rbGS
'
Me.rbGS.AutoSize = True
Me.rbGS.Location = New System.Drawing.Point(62, 3)
Me.rbGS.Name = "rbGS"
Me.rbGS.Size = New System.Drawing.Size(80, 17)
Me.rbGS.TabIndex = 1
Me.rbGS.Text = "GhostScript"
Me.rbGS.UseVisualStyleBackColor = True
'
'rbXPDF
'
Me.rbXPDF.AutoSize = True
Me.rbXPDF.Checked = True
Me.rbXPDF.Location = New System.Drawing.Point(3, 3)
Me.rbXPDF.Name = "rbXPDF"
Me.rbXPDF.Size = New System.Drawing.Size(53, 17)
Me.rbXPDF.TabIndex = 0
Me.rbXPDF.TabStop = True
Me.rbXPDF.Text = "XPDF"
Me.rbXPDF.UseVisualStyleBackColor = True
'
'TextBox1
'
Me.TextBox1.Enabled = False
Me.TextBox1.Location = New System.Drawing.Point(4, 4)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(249, 20)
Me.TextBox1.TabIndex = 1
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(461, 3)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(75, 23)
Me.Button1.TabIndex = 0
Me.Button1.Text = "Browse..."
Me.Button1.UseVisualStyleBackColor = True
'
'Panel2
'
Me.Panel2.Controls.Add(Me.PdfViewer1)
Me.Panel2.Dock = System.Windows.Forms.DockStyle.Fill
Me.Panel2.Location = New System.Drawing.Point(0, 30)
Me.Panel2.Name = "Panel2"
Me.Panel2.Size = New System.Drawing.Size(539, 434)
Me.Panel2.TabIndex = 1
'
'PdfViewer1
'
Me.PdfViewer1.AllowBookmarks = True
Me.PdfViewer1.Dock = System.Windows.Forms.DockStyle.Fill
Me.PdfViewer1.FileName = Nothing
Me.PdfViewer1.Location = New System.Drawing.Point(0, 0)
Me.PdfViewer1.Name = "PdfViewer1"
Me.PdfViewer1.Size = New System.Drawing.Size(539, 434)
Me.PdfViewer1.TabIndex = 0
Me.PdfViewer1.UseXPDF = True
'
'btOCR
'
Me.btOCR.Location = New System.Drawing.Point(255, 3)
Me.btOCR.Name = "btOCR"
Me.btOCR.Size = New System.Drawing.Size(49, 23)
Me.btOCR.TabIndex = 3
Me.btOCR.Text = "OCR"
Me.btOCR.UseVisualStyleBackColor = True
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(539, 464)
Me.Controls.Add(Me.Panel2)
Me.Controls.Add(Me.Panel1)
Me.MinimumSize = New System.Drawing.Size(555, 500)
Me.Name = "Form1"
Me.Text = "Free PDF .NET Viewer"
Me.Panel1.ResumeLayout(False)
Me.Panel1.PerformLayout()
Me.Panel3.ResumeLayout(False)
Me.Panel3.PerformLayout()
Me.Panel2.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog
Friend WithEvents Panel1 As System.Windows.Forms.Panel
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Panel2 As System.Windows.Forms.Panel
Friend WithEvents Panel3 As System.Windows.Forms.Panel
Friend WithEvents rbGS As System.Windows.Forms.RadioButton
Friend WithEvents rbXPDF As System.Windows.Forms.RadioButton
Friend WithEvents PdfViewer1 As PDFView.PDFViewer
Friend WithEvents btOCR As System.Windows.Forms.Button
End Class

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="OpenFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,28 @@
Public Class Form1
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
PdfViewer1.Dispose() 'Necessary to free resources used by the PDF Viewer
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PdfViewer1.SelectFile()
TextBox1.Text = PdfViewer1.FileName
End Sub
Private Sub rbXPDF_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbXPDF.CheckedChanged
If rbXPDF.Checked Then
PdfViewer1.UseXPDF = True
Else
PdfViewer1.UseXPDF = False
End If
PdfViewer1.FileName = PdfViewer1.FileName
End Sub
Private Sub btOCR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btOCR.Click
MsgBox(PdfViewer1.OCRCurrentPage)
End Sub
End Class

View File

@@ -0,0 +1,38 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:2.0.50727.3074
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My
'NOTE: This file is auto-generated; do not modify it directly. To make changes,
' or if you encounter build errors in this file, go to the Project Designer
' (go to Project Properties or double-click the My Project node in
' Solution Explorer), and make changes on the Application tab.
'
Partial Friend Class MyApplication
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Public Sub New()
MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
Me.IsSingleInstance = false
Me.EnableVisualStyles = true
Me.SaveMySettingsOnExit = true
Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
End Sub
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Protected Overrides Sub OnCreateMainForm()
Me.MainForm = Global.SamplePDFViewer.Form1
End Sub
End Class
End Namespace

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>true</MySubMain>
<MainForm>Form1</MainForm>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<ApplicationType>0</ApplicationType>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>

View File

@@ -0,0 +1,35 @@
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("SamplePDFViewer")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("SamplePDFViewer")>
<Assembly: AssemblyCopyright("Copyright © 2009")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("1578ee1b-3e36-42d6-985b-73e2b4ab6291")>
' Version information for an assembly consists of the following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@@ -0,0 +1,63 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:2.0.50727.3074
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Imports System
Namespace My.Resources
'This class was auto-generated by the StronglyTypedResourceBuilder
'class via a tool like ResGen or Visual Studio.
'To add or remove a member, edit your .ResX file then rerun ResGen
'with the /str option, or rebuild your VS project.
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("SamplePDFViewer.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Overrides the current thread's CurrentUICulture property for all
''' resource lookups using this strongly typed resource class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set
resourceCulture = value
End Set
End Property
End Module
End Namespace

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,73 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:2.0.50727.3074
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
#Region "My.Settings Auto-Save Functionality"
#If _MyType = "WindowsForms" Then
Private Shared addedHandler As Boolean
Private Shared addedHandlerLockObject As New Object
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then
My.Settings.Save()
End If
End Sub
#End If
#End Region
Public Shared ReadOnly Property [Default]() As MySettings
Get
#If _MyType = "WindowsForms" Then
If Not addedHandler Then
SyncLock addedHandlerLockObject
If Not addedHandler Then
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
addedHandler = True
End If
End SyncLock
End If
#End If
Return defaultInstance
End Get
End Property
End Class
End Namespace
Namespace My
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.SamplePDFViewer.My.MySettings
Get
Return Global.SamplePDFViewer.My.MySettings.Default
End Get
End Property
End Module
End Namespace

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{ECEEFA4B-5656-4286-A094-CEBB4C5E3760}</ProjectGuid>
<OutputType>WinExe</OutputType>
<StartupObject>SamplePDFViewer.My.MyApplication</StartupObject>
<RootNamespace>SamplePDFViewer</RootNamespace>
<AssemblyName>SamplePDFViewer</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>WindowsForms</MyType>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<OptionExplicit>On</OptionExplicit>
<OptionCompare>Binary</OptionCompare>
<OptionStrict>Off</OptionStrict>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>SamplePDFViewer.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>SamplePDFViewer.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Drawing" />
<Import Include="System.Diagnostics" />
<Import Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.vb">
<DependentUpon>Form1.vb</DependentUpon>
<SubType>Form</SubType>
</Compile>
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PDFView\PDFView.vbproj">
<Project>{170D7D1B-61B9-4E8B-9CD3-88350725379F}</Project>
<Name>PDFView</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>copy "$(SolutionDir)PDFView\lib\gsdll32.dll" "$(TargetDir)"
copy "$(SolutionDir)PDFView\lib\itextsharp.dll" "$(TargetDir)"
copy "$(SolutionDir)PDFView\$(OutDir)PDFView.dll" "$(TargetDir)"
copy "$(SolutionDir)PDFView\$(OutDir)PDFLibNET.dll" "$(TargetDir)"
copy "$(SolutionDir)PDFView\$(OutDir)tessnet2.dll" "$(TargetDir)"
xcopy "$(SolutionDir)PDFView\$(OutDir)tessdata" "$(TargetDir)tessdata" /s /e /i /h /Y</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@@ -0,0 +1,31 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "PDFView", "PDFView\PDFView.vbproj", "{170D7D1B-61B9-4E8B-9CD3-88350725379F}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SamplePDFViewer", "SamplePDFViewer\SamplePDFViewer.vbproj", "{ECEEFA4B-5656-4286-A094-CEBB4C5E3760}"
ProjectSection(ProjectDependencies) = postProject
{170D7D1B-61B9-4E8B-9CD3-88350725379F} = {170D7D1B-61B9-4E8B-9CD3-88350725379F}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{170D7D1B-61B9-4E8B-9CD3-88350725379F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{170D7D1B-61B9-4E8B-9CD3-88350725379F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{170D7D1B-61B9-4E8B-9CD3-88350725379F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{170D7D1B-61B9-4E8B-9CD3-88350725379F}.Release|Any CPU.Build.0 = Release|Any CPU
{ECEEFA4B-5656-4286-A094-CEBB4C5E3760}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ECEEFA4B-5656-4286-A094-CEBB4C5E3760}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ECEEFA4B-5656-4286-A094-CEBB4C5E3760}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ECEEFA4B-5656-4286-A094-CEBB4C5E3760}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,215 @@
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Drawing.Printing
Public Class AFPDFLibUtil
'This uses an XPDF wrapper written by Jose Antonio Sandoval Soria of Guadalajara, México
'The source is available at http://www.codeproject.com/KB/files/xpdf_csharp.aspx
'
'I have ported over to VB.NET select functionality from the C# PDF viewer in the above project
Const RENDER_DPI As Integer = 200
Const PRINT_DPI As Integer = 300
Public Shared Function GetOptimalDPI(ByRef pdfDoc As PDFLibNet.PDFWrapper, ByRef oPictureBox As PictureBox) As Integer
GetOptimalDPI = 0
If pdfDoc IsNot Nothing Then
If pdfDoc.PageWidth > 0 And pdfDoc.PageHeight > 0 Then
Dim DPIScalePercent As Single = 72 / pdfDoc.RenderDPI
Dim picHeight As Integer = oPictureBox.Height
Dim picWidth As Integer = oPictureBox.Width
Dim docHeight As Integer = pdfDoc.PageHeight
Dim docWidth As Integer = pdfDoc.PageWidth
Dim dummyPicBox As New PictureBox
dummyPicBox.Size = oPictureBox.Size
If (picWidth > picHeight And docWidth < docHeight) Or (picWidth < picHeight And docWidth > docHeight) Then
dummyPicBox.Width = picHeight
dummyPicBox.Height = picWidth
End If
Dim HScale As Single = dummyPicBox.Width / (pdfDoc.PageWidth * DPIScalePercent)
Dim VScale As Single = dummyPicBox.Height / (pdfDoc.PageHeight * DPIScalePercent)
dummyPicBox.Dispose()
If VScale > HScale Then
GetOptimalDPI = Math.Floor(72 * HScale)
Else
GetOptimalDPI = Math.Floor(72 * VScale)
End If
End If
End If
End Function
Public Shared Function GetImageFromPDF(ByRef pdfDoc As PDFLibNet.PDFWrapper, ByVal PageNumber As Integer, Optional ByVal DPI As Integer = RENDER_DPI) As System.Drawing.Image
GetImageFromPDF = Nothing
Try
If pdfDoc IsNot Nothing Then
pdfDoc.CurrentPage = PageNumber
pdfDoc.CurrentX = 0
pdfDoc.CurrentY = 0
If DPI < 1 Then DPI = RENDER_DPI
pdfDoc.RenderDPI = DPI
Dim oPictureBox As New PictureBox
pdfDoc.RenderPage(oPictureBox.Handle)
GetImageFromPDF = Render(pdfDoc)
oPictureBox.Dispose()
End If
Catch ex As Exception
Throw ex
End Try
End Function
Public Shared Function Render(ByRef pdfDoc As PDFLibNet.PDFWrapper) As System.Drawing.Bitmap
Try
If pdfDoc IsNot Nothing Then
Dim backbuffer As System.Drawing.Bitmap = New Bitmap(pdfDoc.PageWidth, pdfDoc.PageHeight)
pdfDoc.ClientBounds = New Rectangle(0, 0, pdfDoc.PageWidth, pdfDoc.PageHeight)
Dim g As Graphics = Graphics.FromImage(backbuffer)
Using g
Dim hdc As IntPtr = g.GetHdc()
pdfDoc.DrawPageHDC(hdc)
g.ReleaseHdc()
End Using
g.Dispose()
Return backbuffer
End If
Catch ex As Exception
Throw ex
Return Nothing
End Try
Return Nothing
End Function
Public Shared Sub ExportPDF(ByRef pdfDoc As PDFLibNet.PDFWrapper, ByVal fileName As String, Optional ByVal startPage As Integer = 1, Optional ByVal endPage As Integer = 0)
If Not Nothing Is pdfDoc Then
If endPage = 0 Or endPage > pdfDoc.PageCount Then
endPage = pdfDoc.PageCount
End If
Try
If fileName.EndsWith(".ps") Then
pdfDoc.PrintToFile(fileName, startPage, endPage)
ElseIf fileName.EndsWith(".jpg") Then
pdfDoc.ExportJpg(fileName, 70)
ElseIf fileName.EndsWith(".txt") Then
pdfDoc.ExportText(fileName, startPage, endPage, True, True)
ElseIf fileName.EndsWith(".html") Then
pdfDoc.ExportHtml(fileName, startPage, endPage, True, True, False)
End If
Catch ex As Exception
MessageBox.Show(ex.ToString())
End Try
End If
End Sub
Public Shared Function FillTree(ByRef tvwOutline As TreeView, ByRef pdfDoc As PDFLibNet.PDFWrapper) As Boolean
FillTree = False
tvwOutline.Nodes.Clear()
For Each ol As PDFLibNet.OutlineItem In pdfDoc.Outline
FillTree = True
Dim tn As New TreeNode(ol.Title)
tn.Tag = ol
tvwOutline.Nodes.Add(tn)
If ol.KidsCount > 0 Then
FillTreeRecursive(ol.Childrens, tn)
End If
Next
End Function
Public Shared Sub FillTreeRecursive(ByVal olParent As PDFLibNet.OutlineItemCollection(Of PDFLibNet.OutlineItem), ByVal treeNode As TreeNode)
For Each ol As PDFLibNet.OutlineItem In olParent
Dim tn As New TreeNode(ol.Title)
tn.Tag = ol
treeNode.Nodes.Add(tn)
If ol.KidsCount > 0 Then
FillTreeRecursive(ol.Childrens, tn)
End If
Next
End Sub
Public Shared Function BuildJavaScriptArray(ByRef pdfDoc As PDFLibNet.PDFWrapper) As String
Dim pageCount As Integer = pdfDoc.PageCount
BuildJavaScriptArray = "var myPages=new Array("
For i As Integer = 1 To pageCount
BuildJavaScriptArray &= """images/page" & i & ".png"",)"
Next
BuildJavaScriptArray = BuildJavaScriptArray.Substring(0, BuildJavaScriptArray.Length - 2)
BuildJavaScriptArray &= ");" & vbCrLf & "var myPageCount=" & pageCount & ";"
End Function
Public Shared Function BuildHTMLBookmarks(ByRef pdfDoc As PDFLibNet.PDFWrapper) As String
Dim pageCount As Integer = pdfDoc.PageCount
If pdfDoc.Outline.Count <= 0 Then
StartPageList:
BuildHTMLBookmarks = "<!--PageNumberOnly--><ul>"
For i As Integer = 1 To pageCount
BuildHTMLBookmarks &= "<li><a href=""javascript:changeImage('images/page" & i & ".png')"">Page " & i & "</a></li>"
Next
BuildHTMLBookmarks &= "</ul>"
Exit Function
Else
BuildHTMLBookmarks = ""
FillHTMLTreeRecursive(pdfDoc.Outline, BuildHTMLBookmarks, pdfDoc)
If System.Text.RegularExpressions.Regex.IsMatch(BuildHTMLBookmarks, "\d") = False Then
BuildHTMLBookmarks = ""
GoTo StartPageList
End If
Exit Function
End If
End Function
Public Shared Sub FillHTMLTreeRecursive(ByVal olParent As PDFLibNet.OutlineItemCollection(Of PDFLibNet.OutlineItem), ByRef htmlString As String, ByRef pdfDoc As PDFLibNet.PDFWrapper)
htmlString &= "<ul>"
For Each ol As PDFLibNet.OutlineItem In olParent
htmlString &= "<li><a href=""javascript:changeImage('images/page" & ol.Destination.Page & ".png')"">" & Web.HttpUtility.HtmlEncode(ol.Title) & "</a></li>"
If ol.KidsCount > 0 Then
FillHTMLTreeRecursive(ol.Childrens, htmlString, pdfDoc)
End If
Next
htmlString &= "</ul>"
End Sub
End Class
Public Class PDFOutline
Public Title As String
Public Item As PDFLibNet.OutlineItem
Friend _doc As PDFLibNet.PDFWrapper = Nothing
Friend _children As List(Of PDFOutline)
Public ReadOnly Property Children() As List(Of PDFOutline)
Get
Return _children
End Get
End Property
Friend Sub New(ByVal title__1 As String, ByVal outlineItem As PDFLibNet.OutlineItem, ByVal doc As PDFLibNet.PDFWrapper)
Title = title__1
Item = outlineItem
_doc = doc
End Sub
End Class
Public Class SearchArgs
Inherits EventArgs
Public Text As String
Public FromBegin As Boolean
Public Exact As Boolean
Public WholeDoc As Boolean
Public FindNext As Boolean
Public Up As Boolean
Friend Sub New(ByVal text__1 As String, ByVal frombegin__2 As Boolean, ByVal exact__3 As Boolean, ByVal wholedoc__4 As Boolean, ByVal findnext__5 As Boolean, ByVal up__6 As Boolean)
Text = text__1
FromBegin = frombegin__2
Exact = exact__3
WholeDoc = wholedoc__4
FindNext = findnext__5
Up = up__6
End Sub
End Class

View File

@@ -0,0 +1,299 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class ExportImageOptions
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.rbPDF = New System.Windows.Forms.RadioButton
Me.GroupBox3 = New System.Windows.Forms.GroupBox
Me.cbPageSize = New System.Windows.Forms.ComboBox
Me.Label3 = New System.Windows.Forms.Label
Me.GroupBox2 = New System.Windows.Forms.GroupBox
Me.nuDown = New System.Windows.Forms.NumericUpDown
Me.Label2 = New System.Windows.Forms.Label
Me.nuStart = New System.Windows.Forms.NumericUpDown
Me.Label1 = New System.Windows.Forms.Label
Me.btCancel = New System.Windows.Forms.Button
Me.btOK = New System.Windows.Forms.Button
Me.SaveFileDialog1 = New System.Windows.Forms.SaveFileDialog
Me.GroupBox4 = New System.Windows.Forms.GroupBox
Me.cbLanguage = New System.Windows.Forms.ComboBox
Me.cbOCR = New System.Windows.Forms.CheckBox
Me.GroupBox5 = New System.Windows.Forms.GroupBox
Me.tbUserPass = New System.Windows.Forms.TextBox
Me.tbOwnerPass = New System.Windows.Forms.TextBox
Me.Label4 = New System.Windows.Forms.Label
Me.Label5 = New System.Windows.Forms.Label
Me.GroupBox1.SuspendLayout()
Me.GroupBox3.SuspendLayout()
Me.GroupBox2.SuspendLayout()
CType(Me.nuDown, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.nuStart, System.ComponentModel.ISupportInitialize).BeginInit()
Me.GroupBox4.SuspendLayout()
Me.GroupBox5.SuspendLayout()
Me.SuspendLayout()
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.rbPDF)
Me.GroupBox1.Location = New System.Drawing.Point(12, 12)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(260, 49)
Me.GroupBox1.TabIndex = 1
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "File Format"
'
'rbPDF
'
Me.rbPDF.AutoSize = True
Me.rbPDF.Checked = True
Me.rbPDF.Location = New System.Drawing.Point(7, 19)
Me.rbPDF.Name = "rbPDF"
Me.rbPDF.Size = New System.Drawing.Size(46, 17)
Me.rbPDF.TabIndex = 0
Me.rbPDF.TabStop = True
Me.rbPDF.Tag = "Portable Document Format (*.pdf)|*.pdf"
Me.rbPDF.Text = "PDF"
Me.rbPDF.UseVisualStyleBackColor = True
'
'GroupBox3
'
Me.GroupBox3.Controls.Add(Me.cbPageSize)
Me.GroupBox3.Controls.Add(Me.Label3)
Me.GroupBox3.Location = New System.Drawing.Point(12, 67)
Me.GroupBox3.Name = "GroupBox3"
Me.GroupBox3.Size = New System.Drawing.Size(260, 53)
Me.GroupBox3.TabIndex = 6
Me.GroupBox3.TabStop = False
Me.GroupBox3.Text = "PDF Options"
'
'cbPageSize
'
Me.cbPageSize.FormattingEnabled = True
Me.cbPageSize.Location = New System.Drawing.Point(70, 21)
Me.cbPageSize.Name = "cbPageSize"
Me.cbPageSize.Size = New System.Drawing.Size(121, 21)
Me.cbPageSize.TabIndex = 2
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(6, 24)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(58, 13)
Me.Label3.TabIndex = 1
Me.Label3.Text = "Page Size:"
'
'GroupBox2
'
Me.GroupBox2.Controls.Add(Me.nuDown)
Me.GroupBox2.Controls.Add(Me.Label2)
Me.GroupBox2.Controls.Add(Me.nuStart)
Me.GroupBox2.Controls.Add(Me.Label1)
Me.GroupBox2.Location = New System.Drawing.Point(13, 270)
Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(260, 57)
Me.GroupBox2.TabIndex = 5
Me.GroupBox2.TabStop = False
Me.GroupBox2.Text = "Page Range"
'
'nuDown
'
Me.nuDown.Location = New System.Drawing.Point(168, 24)
Me.nuDown.Minimum = New Decimal(New Integer() {1, 0, 0, 0})
Me.nuDown.Name = "nuDown"
Me.nuDown.Size = New System.Drawing.Size(48, 20)
Me.nuDown.TabIndex = 3
Me.nuDown.Value = New Decimal(New Integer() {1, 0, 0, 0})
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(120, 26)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(43, 13)
Me.Label2.TabIndex = 2
Me.Label2.Text = "to page"
'
'nuStart
'
Me.nuStart.Location = New System.Drawing.Point(65, 24)
Me.nuStart.Minimum = New Decimal(New Integer() {1, 0, 0, 0})
Me.nuStart.Name = "nuStart"
Me.nuStart.Size = New System.Drawing.Size(48, 20)
Me.nuStart.TabIndex = 1
Me.nuStart.Value = New Decimal(New Integer() {1, 0, 0, 0})
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(6, 26)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(57, 13)
Me.Label1.TabIndex = 0
Me.Label1.Text = "From page"
'
'btCancel
'
Me.btCancel.Location = New System.Drawing.Point(117, 333)
Me.btCancel.Name = "btCancel"
Me.btCancel.Size = New System.Drawing.Size(75, 23)
Me.btCancel.TabIndex = 8
Me.btCancel.Text = "Cancel"
Me.btCancel.UseVisualStyleBackColor = True
'
'btOK
'
Me.btOK.Location = New System.Drawing.Point(198, 333)
Me.btOK.Name = "btOK"
Me.btOK.Size = New System.Drawing.Size(75, 23)
Me.btOK.TabIndex = 7
Me.btOK.Text = "OK"
Me.btOK.UseVisualStyleBackColor = True
'
'GroupBox4
'
Me.GroupBox4.Controls.Add(Me.cbLanguage)
Me.GroupBox4.Controls.Add(Me.cbOCR)
Me.GroupBox4.Location = New System.Drawing.Point(12, 128)
Me.GroupBox4.Name = "GroupBox4"
Me.GroupBox4.Size = New System.Drawing.Size(260, 53)
Me.GroupBox4.TabIndex = 7
Me.GroupBox4.TabStop = False
Me.GroupBox4.Text = "OCR Options"
'
'cbLanguage
'
Me.cbLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cbLanguage.FormattingEnabled = True
Me.cbLanguage.Items.AddRange(New Object() {"English"})
Me.cbLanguage.Location = New System.Drawing.Point(126, 17)
Me.cbLanguage.Name = "cbLanguage"
Me.cbLanguage.Size = New System.Drawing.Size(121, 21)
Me.cbLanguage.TabIndex = 3
'
'cbOCR
'
Me.cbOCR.AutoSize = True
Me.cbOCR.Location = New System.Drawing.Point(10, 19)
Me.cbOCR.Name = "cbOCR"
Me.cbOCR.Size = New System.Drawing.Size(110, 17)
Me.cbOCR.TabIndex = 2
Me.cbOCR.Text = "Make Searchable"
Me.cbOCR.UseVisualStyleBackColor = True
'
'GroupBox5
'
Me.GroupBox5.Controls.Add(Me.Label5)
Me.GroupBox5.Controls.Add(Me.Label4)
Me.GroupBox5.Controls.Add(Me.tbOwnerPass)
Me.GroupBox5.Controls.Add(Me.tbUserPass)
Me.GroupBox5.Location = New System.Drawing.Point(13, 188)
Me.GroupBox5.Name = "GroupBox5"
Me.GroupBox5.Size = New System.Drawing.Size(259, 76)
Me.GroupBox5.TabIndex = 9
Me.GroupBox5.TabStop = False
Me.GroupBox5.Text = "Password Options"
'
'tbUserPass
'
Me.tbUserPass.Location = New System.Drawing.Point(64, 19)
Me.tbUserPass.Name = "tbUserPass"
Me.tbUserPass.Size = New System.Drawing.Size(182, 20)
Me.tbUserPass.TabIndex = 0
'
'tbOwnerPass
'
Me.tbOwnerPass.Location = New System.Drawing.Point(64, 46)
Me.tbOwnerPass.Name = "tbOwnerPass"
Me.tbOwnerPass.Size = New System.Drawing.Size(182, 20)
Me.tbOwnerPass.TabIndex = 1
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(23, 22)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(29, 13)
Me.Label4.TabIndex = 2
Me.Label4.Text = "User"
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(23, 49)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(38, 13)
Me.Label5.TabIndex = 3
Me.Label5.Text = "Owner"
'
'ExportImageOptions
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(284, 363)
Me.Controls.Add(Me.GroupBox5)
Me.Controls.Add(Me.GroupBox4)
Me.Controls.Add(Me.btCancel)
Me.Controls.Add(Me.btOK)
Me.Controls.Add(Me.GroupBox3)
Me.Controls.Add(Me.GroupBox2)
Me.Controls.Add(Me.GroupBox1)
Me.Name = "ExportImageOptions"
Me.Text = "Export Image Options"
Me.GroupBox1.ResumeLayout(False)
Me.GroupBox1.PerformLayout()
Me.GroupBox3.ResumeLayout(False)
Me.GroupBox3.PerformLayout()
Me.GroupBox2.ResumeLayout(False)
Me.GroupBox2.PerformLayout()
CType(Me.nuDown, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.nuStart, System.ComponentModel.ISupportInitialize).EndInit()
Me.GroupBox4.ResumeLayout(False)
Me.GroupBox4.PerformLayout()
Me.GroupBox5.ResumeLayout(False)
Me.GroupBox5.PerformLayout()
Me.ResumeLayout(False)
End Sub
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents rbPDF As System.Windows.Forms.RadioButton
Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
Friend WithEvents cbPageSize As System.Windows.Forms.ComboBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
Friend WithEvents nuDown As System.Windows.Forms.NumericUpDown
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents nuStart As System.Windows.Forms.NumericUpDown
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents btCancel As System.Windows.Forms.Button
Friend WithEvents btOK As System.Windows.Forms.Button
Friend WithEvents SaveFileDialog1 As System.Windows.Forms.SaveFileDialog
Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox
Friend WithEvents cbLanguage As System.Windows.Forms.ComboBox
Friend WithEvents cbOCR As System.Windows.Forms.CheckBox
Friend WithEvents GroupBox5 As System.Windows.Forms.GroupBox
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents tbOwnerPass As System.Windows.Forms.TextBox
Friend WithEvents tbUserPass As System.Windows.Forms.TextBox
End Class

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="SaveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,104 @@
Imports System.Windows.Forms
Public Class ExportImageOptions
Dim mImgFileNames As String()
Dim mFilter As String = ""
Dim IsMultiple As Boolean = False
Public SavedFileName As String = ""
Public Sub New(ByVal imgFileNames As String())
' This call is required by the Windows Form Designer.
InitializeComponent()
If imgFileNames.Length = 1 Then
Dim pageCount As Integer = ImageUtil.GetImageFrameCount(imgFileNames(0))
If pageCount > 1 Then
nuStart.Maximum = pageCount
nuStart.Value = 1
nuDown.Maximum = pageCount
nuDown.Value = pageCount
Else
DisablePageRange()
End If
Else
DisablePageRange()
End If
mImgFileNames = imgFileNames
SaveFileDialog1.Filter = rbPDF.Tag
End Sub
Private Sub DisablePageRange()
nuStart.Maximum = 0
nuStart.Value = 0
nuDown.Maximum = 0
nuDown.Value = 0
GroupBox2.Visible = False
End Sub
Private Sub ExportImageOptions_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
LoadPageSizes()
LoadLanguages()
End Sub
Private Sub LoadPageSizes()
Dim hash As New List(Of DictionaryEntry)
hash.Add(New DictionaryEntry("Letter", iTextSharp.text.PageSize.LETTER))
hash.Add(New DictionaryEntry("Legal", iTextSharp.text.PageSize.LEGAL))
hash.Add(New DictionaryEntry("Ledger", iTextSharp.text.PageSize._11X17))
hash.Add(New DictionaryEntry("Executive", iTextSharp.text.PageSize.EXECUTIVE))
hash.Add(New DictionaryEntry("A4", iTextSharp.text.PageSize.A4))
hash.Add(New DictionaryEntry("B4", iTextSharp.text.PageSize.B4))
hash.Add(New DictionaryEntry("A3", iTextSharp.text.PageSize.A3))
cbPageSize.DataSource = hash
cbPageSize.DisplayMember = "Key"
End Sub
Private Sub LoadLanguages()
'Make sure all of the language files are in the \tessdata directory
Dim hash As New List(Of DictionaryEntry)
hash.Add(New DictionaryEntry("English", TesseractOCR.Language.English))
'hash.Add(New DictionaryEntry("Basque", TesseractOCR.Language.Basque))
'hash.Add(New DictionaryEntry("Dutch", TesseractOCR.Language.Dutch))
'hash.Add(New DictionaryEntry("Fraktur", TesseractOCR.Language.Fraktur))
'hash.Add(New DictionaryEntry("French", TesseractOCR.Language.French))
'hash.Add(New DictionaryEntry("German", TesseractOCR.Language.German))
'hash.Add(New DictionaryEntry("Italian", TesseractOCR.Language.Italian))
'hash.Add(New DictionaryEntry("Portuguese", TesseractOCR.Language.Portuguese))
'hash.Add(New DictionaryEntry("Spanish", TesseractOCR.Language.Spanish))
'hash.Add(New DictionaryEntry("Vietnamese", TesseractOCR.Language.Vietnamese))
cbLanguage.DataSource = hash
cbLanguage.DisplayMember = "Key"
End Sub
Private Sub btCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btCancel.Click
Me.Hide()
End Sub
Private Sub nuStart_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles nuStart.ValueChanged
If nuStart.Value > nuDown.Value Then
nuStart.Value = nuDown.Value
End If
End Sub
Private Sub nuDown_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles nuDown.ValueChanged
If nuDown.Value < nuStart.Value Then
nuDown.Value = nuStart.Value
End If
End Sub
Private Sub btOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btOK.Click
If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
Windows.Forms.Cursor.Current = Windows.Forms.Cursors.WaitCursor
Dim filename As String = SaveFileDialog1.FileName
If filename.EndsWith(".pdf") Then
iTextSharpUtil.GraphicListToPDF(mImgFileNames, SaveFileDialog1.FileName, cbPageSize.SelectedValue.Value, IIf(cbOCR.Checked, cbLanguage.SelectedValue.Value, ""), nuStart.Value, nuDown.Value, tbUserPass.Text, tbOwnerPass.Text)
SavedFileName = SaveFileDialog1.FileName
End If
Windows.Forms.Cursor.Current = Windows.Forms.Cursors.Default
End If
Me.Hide()
End Sub
End Class

View File

@@ -0,0 +1,304 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class ExportOptions
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.rbHtmlImage = New System.Windows.Forms.RadioButton
Me.rbTIFF = New System.Windows.Forms.RadioButton
Me.rbPNG = New System.Windows.Forms.RadioButton
Me.rbJpeg = New System.Windows.Forms.RadioButton
Me.rbText = New System.Windows.Forms.RadioButton
Me.rbHtml = New System.Windows.Forms.RadioButton
Me.rbPostscript = New System.Windows.Forms.RadioButton
Me.GroupBox2 = New System.Windows.Forms.GroupBox
Me.nuDown = New System.Windows.Forms.NumericUpDown
Me.Label2 = New System.Windows.Forms.Label
Me.nuStart = New System.Windows.Forms.NumericUpDown
Me.Label1 = New System.Windows.Forms.Label
Me.btOK = New System.Windows.Forms.Button
Me.btCancel = New System.Windows.Forms.Button
Me.SaveFileDialog1 = New System.Windows.Forms.SaveFileDialog
Me.GroupBox3 = New System.Windows.Forms.GroupBox
Me.Label4 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.nuDPI = New System.Windows.Forms.NumericUpDown
Me.GroupBox1.SuspendLayout()
Me.GroupBox2.SuspendLayout()
CType(Me.nuDown, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.nuStart, System.ComponentModel.ISupportInitialize).BeginInit()
Me.GroupBox3.SuspendLayout()
CType(Me.nuDPI, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.rbHtmlImage)
Me.GroupBox1.Controls.Add(Me.rbTIFF)
Me.GroupBox1.Controls.Add(Me.rbPNG)
Me.GroupBox1.Controls.Add(Me.rbJpeg)
Me.GroupBox1.Controls.Add(Me.rbText)
Me.GroupBox1.Controls.Add(Me.rbHtml)
Me.GroupBox1.Controls.Add(Me.rbPostscript)
Me.GroupBox1.Location = New System.Drawing.Point(12, 12)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(260, 114)
Me.GroupBox1.TabIndex = 0
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "File Format"
'
'rbHtmlImage
'
Me.rbHtmlImage.AutoSize = True
Me.rbHtmlImage.Location = New System.Drawing.Point(6, 88)
Me.rbHtmlImage.Name = "rbHtmlImage"
Me.rbHtmlImage.Size = New System.Drawing.Size(128, 17)
Me.rbHtmlImage.TabIndex = 6
Me.rbHtmlImage.TabStop = True
Me.rbHtmlImage.Tag = "HTML (*.html)|*.html"
Me.rbHtmlImage.Text = "HTML (Image Viewer)"
Me.rbHtmlImage.UseVisualStyleBackColor = True
'
'rbTIFF
'
Me.rbTIFF.AutoSize = True
Me.rbTIFF.Location = New System.Drawing.Point(139, 42)
Me.rbTIFF.Name = "rbTIFF"
Me.rbTIFF.Size = New System.Drawing.Size(47, 17)
Me.rbTIFF.TabIndex = 5
Me.rbTIFF.TabStop = True
Me.rbTIFF.Tag = "TIFF (*.tif)|*.tif"
Me.rbTIFF.Text = "TIFF"
Me.rbTIFF.UseVisualStyleBackColor = True
'
'rbPNG
'
Me.rbPNG.AutoSize = True
Me.rbPNG.Location = New System.Drawing.Point(6, 65)
Me.rbPNG.Name = "rbPNG"
Me.rbPNG.Size = New System.Drawing.Size(48, 17)
Me.rbPNG.TabIndex = 4
Me.rbPNG.TabStop = True
Me.rbPNG.Tag = "PNG (*.png)|*.png"
Me.rbPNG.Text = "PNG"
Me.rbPNG.UseVisualStyleBackColor = True
'
'rbJpeg
'
Me.rbJpeg.AutoSize = True
Me.rbJpeg.Location = New System.Drawing.Point(139, 19)
Me.rbJpeg.Name = "rbJpeg"
Me.rbJpeg.Size = New System.Drawing.Size(55, 17)
Me.rbJpeg.TabIndex = 3
Me.rbJpeg.TabStop = True
Me.rbJpeg.Tag = "JPEG (*.jpg)|*.jpg"
Me.rbJpeg.Text = "JPEG "
Me.rbJpeg.UseVisualStyleBackColor = True
'
'rbText
'
Me.rbText.AutoSize = True
Me.rbText.Location = New System.Drawing.Point(6, 42)
Me.rbText.Name = "rbText"
Me.rbText.Size = New System.Drawing.Size(72, 17)
Me.rbText.TabIndex = 2
Me.rbText.TabStop = True
Me.rbText.Tag = "Plain Text (*.txt)|*.txt"
Me.rbText.Text = "Plain Text"
Me.rbText.UseVisualStyleBackColor = True
'
'rbHtml
'
Me.rbHtml.AutoSize = True
Me.rbHtml.Location = New System.Drawing.Point(139, 65)
Me.rbHtml.Name = "rbHtml"
Me.rbHtml.Size = New System.Drawing.Size(115, 17)
Me.rbHtml.TabIndex = 1
Me.rbHtml.TabStop = True
Me.rbHtml.Tag = "HTML (*.html)|*.html"
Me.rbHtml.Text = "HTML (Web Page)"
Me.rbHtml.UseVisualStyleBackColor = True
'
'rbPostscript
'
Me.rbPostscript.AutoSize = True
Me.rbPostscript.Location = New System.Drawing.Point(6, 19)
Me.rbPostscript.Name = "rbPostscript"
Me.rbPostscript.Size = New System.Drawing.Size(71, 17)
Me.rbPostscript.TabIndex = 0
Me.rbPostscript.TabStop = True
Me.rbPostscript.Tag = "PostScript (*.ps)|*.ps"
Me.rbPostscript.Text = "Postscript"
Me.rbPostscript.UseVisualStyleBackColor = True
'
'GroupBox2
'
Me.GroupBox2.Controls.Add(Me.nuDown)
Me.GroupBox2.Controls.Add(Me.Label2)
Me.GroupBox2.Controls.Add(Me.nuStart)
Me.GroupBox2.Controls.Add(Me.Label1)
Me.GroupBox2.Location = New System.Drawing.Point(12, 189)
Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(260, 57)
Me.GroupBox2.TabIndex = 1
Me.GroupBox2.TabStop = False
Me.GroupBox2.Text = "Page Range"
'
'nuDown
'
Me.nuDown.Location = New System.Drawing.Point(168, 24)
Me.nuDown.Minimum = New Decimal(New Integer() {1, 0, 0, 0})
Me.nuDown.Name = "nuDown"
Me.nuDown.Size = New System.Drawing.Size(48, 20)
Me.nuDown.TabIndex = 3
Me.nuDown.Value = New Decimal(New Integer() {1, 0, 0, 0})
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(120, 26)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(43, 13)
Me.Label2.TabIndex = 2
Me.Label2.Text = "to page"
'
'nuStart
'
Me.nuStart.Location = New System.Drawing.Point(65, 24)
Me.nuStart.Minimum = New Decimal(New Integer() {1, 0, 0, 0})
Me.nuStart.Name = "nuStart"
Me.nuStart.Size = New System.Drawing.Size(48, 20)
Me.nuStart.TabIndex = 1
Me.nuStart.Value = New Decimal(New Integer() {1, 0, 0, 0})
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(6, 26)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(57, 13)
Me.Label1.TabIndex = 0
Me.Label1.Text = "From page"
'
'btOK
'
Me.btOK.Location = New System.Drawing.Point(197, 253)
Me.btOK.Name = "btOK"
Me.btOK.Size = New System.Drawing.Size(75, 23)
Me.btOK.TabIndex = 2
Me.btOK.Text = "OK"
Me.btOK.UseVisualStyleBackColor = True
'
'btCancel
'
Me.btCancel.Location = New System.Drawing.Point(116, 253)
Me.btCancel.Name = "btCancel"
Me.btCancel.Size = New System.Drawing.Size(75, 23)
Me.btCancel.TabIndex = 3
Me.btCancel.Text = "Cancel"
Me.btCancel.UseVisualStyleBackColor = True
'
'GroupBox3
'
Me.GroupBox3.Controls.Add(Me.Label4)
Me.GroupBox3.Controls.Add(Me.Label3)
Me.GroupBox3.Controls.Add(Me.nuDPI)
Me.GroupBox3.Location = New System.Drawing.Point(12, 132)
Me.GroupBox3.Name = "GroupBox3"
Me.GroupBox3.Size = New System.Drawing.Size(260, 53)
Me.GroupBox3.TabIndex = 4
Me.GroupBox3.TabStop = False
Me.GroupBox3.Text = "Image Options"
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(129, 24)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(25, 13)
Me.Label4.TabIndex = 2
Me.Label4.Text = "DPI"
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(6, 24)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(60, 13)
Me.Label3.TabIndex = 1
Me.Label3.Text = "Resolution:"
'
'nuDPI
'
Me.nuDPI.Location = New System.Drawing.Point(66, 22)
Me.nuDPI.Maximum = New Decimal(New Integer() {1200, 0, 0, 0})
Me.nuDPI.Minimum = New Decimal(New Integer() {72, 0, 0, 0})
Me.nuDPI.Name = "nuDPI"
Me.nuDPI.Size = New System.Drawing.Size(58, 20)
Me.nuDPI.TabIndex = 0
Me.nuDPI.Value = New Decimal(New Integer() {72, 0, 0, 0})
'
'ExportOptions
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(284, 282)
Me.Controls.Add(Me.GroupBox3)
Me.Controls.Add(Me.btCancel)
Me.Controls.Add(Me.btOK)
Me.Controls.Add(Me.GroupBox2)
Me.Controls.Add(Me.GroupBox1)
Me.Name = "ExportOptions"
Me.Text = "Export PDF Options"
Me.GroupBox1.ResumeLayout(False)
Me.GroupBox1.PerformLayout()
Me.GroupBox2.ResumeLayout(False)
Me.GroupBox2.PerformLayout()
CType(Me.nuDown, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.nuStart, System.ComponentModel.ISupportInitialize).EndInit()
Me.GroupBox3.ResumeLayout(False)
Me.GroupBox3.PerformLayout()
CType(Me.nuDPI, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents rbJpeg As System.Windows.Forms.RadioButton
Friend WithEvents rbText As System.Windows.Forms.RadioButton
Friend WithEvents rbHtml As System.Windows.Forms.RadioButton
Friend WithEvents rbPostscript As System.Windows.Forms.RadioButton
Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
Friend WithEvents nuDown As System.Windows.Forms.NumericUpDown
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents nuStart As System.Windows.Forms.NumericUpDown
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents btOK As System.Windows.Forms.Button
Friend WithEvents btCancel As System.Windows.Forms.Button
Friend WithEvents SaveFileDialog1 As System.Windows.Forms.SaveFileDialog
Friend WithEvents rbTIFF As System.Windows.Forms.RadioButton
Friend WithEvents rbPNG As System.Windows.Forms.RadioButton
Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents nuDPI As System.Windows.Forms.NumericUpDown
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents rbHtmlImage As System.Windows.Forms.RadioButton
End Class

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="SaveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,158 @@
Imports System.Text.RegularExpressions
Public Class ExportOptions
Dim mpdfDoc As PDFLibNet.PDFWrapper
Dim mPdfFileName As String
Dim mFilter As String = ""
Dim mPassword As String = ""
Const BW_TIFF_G4 As String = "tiffg4"
Const BW_TIFF_LZW As String = "tifflzw"
Const GRAY_TIFF_NC As String = "tiffgray"
Const GRAY_PNG = "pnggray"
Const GRAY_JPG = "jpeggray"
Const COLOR_TIFF_RGB As String = "tiff24nc"
Const COLOR_TIFF_CMYK As String = "tiff32nc"
Const COLOR_TIFF_CMYK_SEP As String = "tiffsep"
Const COLOR_PNG_RGB As String = "png16m"
Const COLOR_JPEG = "jpeg"
Public Sub New(ByVal pdfFileName As String, ByVal pdfDoc As PDFLibNet.PDFWrapper, Optional ByVal password As String = "")
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
mPdfFileName = pdfFileName
mpdfDoc = pdfDoc
mPassword = password
nuStart.Maximum = mpdfDoc.PageCount
nuStart.Value = 1
nuDown.Maximum = mpdfDoc.PageCount
nuDown.Value = mpdfDoc.PageCount
nuDPI.Value = 150
SaveFileDialog1.Filter = rbPostscript.Tag
End Sub
Private Sub btOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btOK.Click
If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
Windows.Forms.Cursor.Current = Windows.Forms.Cursors.WaitCursor
Dim filename As String = SaveFileDialog1.FileName
If filename.EndsWith(".ps") Then
mpdfDoc.PrintToFile(filename, nuStart.Value, nuDown.Value)
ElseIf filename.EndsWith(".jpg") Then
ConvertPDF.PDFConvert.ConvertPdfToGraphic(mPdfFileName, SaveFileDialog1.FileName, COLOR_JPEG, nuDPI.Value, nuStart.Value, nuDown.Value, False, mPassword)
ElseIf filename.EndsWith(".tif") Then
Dim returnFileName As String
returnFileName = ConvertPDF.PDFConvert.ConvertPdfToGraphic(mPdfFileName, SaveFileDialog1.FileName, COLOR_TIFF_RGB, nuDPI.Value, nuStart.Value, nuDown.Value, False, mPassword)
Try
ImageUtil.CompressTiff(returnFileName)
Catch
MsgBox("An error occurred while applying LZW compression to the TIFF file. The TIFF file has been saved in an uncompressed format instead.", MsgBoxStyle.OkOnly, "TIFF Compression Error")
End Try
ElseIf filename.EndsWith(".png") Then
ConvertPDF.PDFConvert.ConvertPdfToGraphic(mPdfFileName, SaveFileDialog1.FileName, COLOR_PNG_RGB, nuDPI.Value, nuStart.Value, nuDown.Value, False, mPassword)
ElseIf filename.EndsWith(".txt") Then
mpdfDoc.ExportText(filename, nuStart.Value, nuDown.Value, True, True)
ElseIf filename.EndsWith(".html") And rbHtml.Checked Then
mpdfDoc.ExportHtml(filename, nuStart.Value, nuDown.Value, True, True, False)
ElseIf filename.EndsWith(".html") And rbHtmlImage.Checked Then
ExportHTMLImages(filename)
End If
Windows.Forms.Cursor.Current = Windows.Forms.Cursors.Default
End If
Me.Hide()
End Sub
Private Sub nuStart_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles nuStart.ValueChanged
If nuStart.Value > nuDown.Value Then
nuStart.Value = nuDown.Value
End If
End Sub
Private Sub nuDown_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles nuDown.ValueChanged
If nuDown.Value < nuStart.Value Then
nuDown.Value = nuStart.Value
End If
End Sub
Private Sub CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rbHtml.CheckedChanged, rbJpeg.CheckedChanged, rbPostscript.CheckedChanged, rbText.CheckedChanged, rbPNG.CheckedChanged, rbTIFF.CheckedChanged, rbHtmlImage.CheckedChanged
If rbHtml.Checked Then
SaveFileDialog1.Filter = rbHtml.Tag
GroupBox3.Enabled = False
ElseIf rbHtmlImage.Checked Then
SaveFileDialog1.Filter = rbHtmlImage.Tag
GroupBox3.Enabled = True
ElseIf rbJpeg.Checked Then
SaveFileDialog1.Filter = rbJpeg.Tag
GroupBox3.Enabled = True
ElseIf rbPostscript.Checked Then
SaveFileDialog1.Filter = rbPostscript.Tag
GroupBox3.Enabled = False
ElseIf rbText.Checked Then
SaveFileDialog1.Filter = rbText.Tag
GroupBox3.Enabled = False
ElseIf rbPNG.Checked Then
SaveFileDialog1.Filter = rbPNG.Tag
GroupBox3.Enabled = True
ElseIf rbTIFF.Checked Then
SaveFileDialog1.Filter = rbTIFF.Tag
GroupBox3.Enabled = True
End If
End Sub
Private Sub btCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btCancel.Click
Me.Hide()
End Sub
Private Sub ExportHTMLImages(ByVal fileName As String)
Dim folderPath As String = System.Text.RegularExpressions.Regex.Replace(fileName, "(^.+\\).+$", "$1")
Dim contentFolder As String = folderPath & "content"
Dim imagesFolder As String = contentFolder & "\images"
Dim topFrame As String = My.Resources.TopHtml
topFrame = Regex.Replace(topFrame, "\{DocumentName\}", "<center><h2>" & Regex.Replace(mPdfFileName, "^.+\\", "") & "</h2></center>")
Dim sideFrame As String = My.Resources.BookmarkHtml
'Possible to allow some export from GhostScript renderer
sideFrame = Regex.Replace(sideFrame, "\{Body\}", AFPDFLibUtil.BuildHTMLBookmarks(mpdfDoc))
Dim pageFrame As String = My.Resources.PageHtml
Dim mainPage As String = My.Resources.FrameHtml
Dim pageSize As String = My.Resources.PagesizeHtml
Dim di As System.IO.DirectoryInfo
di = New System.IO.DirectoryInfo(contentFolder)
If (Not di.Exists) Then
di.Create()
End If
di = New System.IO.DirectoryInfo(imagesFolder)
If (Not di.Exists) Then
di.Create()
End If
Dim sw As New IO.StreamWriter(fileName, False)
sw.Write(mainPage)
sw.Close()
Dim sw1 As New IO.StreamWriter(contentFolder & "\top.html", False)
sw1.Write(topFrame)
sw1.Close()
Dim sw2 As New IO.StreamWriter(contentFolder & "\bookmark.html", False)
sw2.Write(sideFrame)
sw2.Close()
Dim sw3 As New IO.StreamWriter(contentFolder & "\page.html", False)
sw3.Write(pageFrame)
sw3.Close()
Dim sw4 As New IO.StreamWriter(contentFolder & "\pagesize.html", False)
sw4.Write(pageSize)
sw4.Close()
ConvertPDF.PDFConvert.ConvertPdfToGraphic(mPdfFileName, imagesFolder & "\page.png", COLOR_PNG_RGB, nuDPI.Value, nuStart.Value, nuDown.Value, False, mPassword)
End Sub
End Class

View File

@@ -0,0 +1,40 @@
Imports System.Drawing
Imports System.Windows.Forms
Public Class FormUtil
Public Shared Function GetFormImage(ByRef myForm As Form) As Bitmap
Dim g As Graphics = myForm.CreateGraphics()
Dim s As Size = myForm.Size
GetFormImage = New Bitmap(s.Width, s.Height, g)
Dim mg As Graphics = Graphics.FromImage(GetFormImage)
Dim dc1 As IntPtr = g.GetHdc
Dim dc2 As IntPtr = mg.GetHdc
' added code to compute and capture the form
' title bar and borders
Dim widthDiff As Integer = _
(myForm.Width - myForm.ClientRectangle.Width)
Dim heightDiff As Integer = _
(myForm.Height - myForm.ClientRectangle.Height)
Dim borderSize As Integer = widthDiff \ 2
Dim heightTitleBar As Integer = heightDiff - borderSize
BitBlt(dc2, 0, 0, _
myForm.ClientRectangle.Width + widthDiff, _
myForm.ClientRectangle.Height + heightDiff, dc1, _
0 - borderSize, 0 - heightTitleBar, 13369376)
g.ReleaseHdc(dc1)
mg.ReleaseHdc(dc2)
End Function
Private Declare Function BitBlt Lib "gdi32.dll" Alias _
"BitBlt" (ByVal hdcDest As IntPtr, _
ByVal nXDest As Integer, ByVal nYDest As _
Integer, ByVal nWidth As Integer, _
ByVal nHeight As Integer, ByVal _
hdcSrc As IntPtr, ByVal nXSrc As Integer, _
ByVal nYSrc As Integer, _
ByVal dwRop As System.Int32) As Long
End Class

View File

@@ -0,0 +1,935 @@
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Runtime.InteropServices
Imports System.Collections
Imports System.IO
Imports System.Drawing
Imports System.Windows.Forms
Namespace ConvertPDF
''' <summary>
''' Create by : TaGoH
''' URL of the last version: http://www.codeproject.com/KB/cs/GhostScriptUseWithCSharp.aspx
''' Description:
''' Class to convert a pdf to an image using GhostScript DLL
''' A big Credit for this code go to:Rangel Avulso
''' I mainly create a better interface and refactor it to made it ready to use!
''' </summary>
Public Class PDFConvert
#Region "Static"
''' <summary>Use to check for default transformation</summary>
Private Shared useSimpleAnsiConversion As Boolean = True
''' <summary>Thanks to tchu_2000 to remind that u should never hardcode strings! :)</summary>
Private Const GS_OutputFileFormat As String = "-sOutputFile={0}"
Private Const GS_DeviceFormat As String = "-sDEVICE={0}"
Private Const GS_FirstParameter As String = "pdf2img"
Private Const GS_ResolutionXFormat As String = "-r{0}"
Private Const GS_ResolutionXYFormat As String = "-r{0}x{1}"
Private Const GS_GraphicsAlphaBits As String = "-dGraphicsAlphaBits={0}"
Private Const GS_TextAlphaBits As String = "-dTextAlphaBits={0}"
Private Const GS_FirstPageFormat As String = "-dFirstPage={0}"
Private Const GS_LastPageFormat As String = "-dLastPage={0}"
Private Const GS_FitPage As String = "-dPDFFitPage"
Private Const GS_PageSizeFormat As String = "-g{0}x{1}"
Private Const GS_DefaultPaperSize As String = "-sPAPERSIZE={0}"
Private Const GS_JpegQualityFormat As String = "-dJPEGQ={0}"
Private Const GS_RenderingThreads As String = "-dNumRenderingThreads={0}"
Private Const GS_Fixed1stParameter As String = "-dNOPAUSE"
Private Const GS_Fixed2ndParameter As String = "-dBATCH"
Private Const GS_Fixed3rdParameter As String = "-dSAFER"
Private Const GS_FixedMedia As String = "-dFIXEDMEDIA"
Private Const GS_QuiteOperation As String = "-q"
Private Const GS_StandardOutputDevice As String = "-"
Private Const GS_MultiplePageCharacter As String = "%"
Private Const GS_MaxBitmap As String = "-dMaxBitmap={0}"
Private Const GS_BufferSpace As String = "-dBufferSpace={0}"
Private Const GS_Password As String = "-sPDFPassword={0}"
#End Region
#Region "Windows Import"
''' <summary>Needed to copy memory from one location to another, used to fill the struct</summary>
''' <param name="Destination"></param>
''' <param name="Source"></param>
''' <param name="Length"></param>
<DllImport("kernel32.dll", EntryPoint:="RtlMoveMemory")> _
Private Shared Sub CopyMemory(ByVal Destination As IntPtr, ByVal Source As IntPtr, ByVal Length As UInteger)
End Sub
#End Region
#Region "GhostScript Import"
''' <summary>Create a new instance of Ghostscript. This instance is passed to most other gsapi functions. The caller_handle will be provided to callback functions.
''' At this stage, Ghostscript supports only one instance. </summary>
''' <param name="pinstance"></param>
''' <param name="caller_handle"></param>
''' <returns></returns>
<DllImport("gsdll32.dll", EntryPoint:="gsapi_new_instance")> _
Private Shared Function gsapi_new_instance(ByRef pinstance As IntPtr, ByVal caller_handle As IntPtr) As Integer
End Function
''' <summary>This is the important function that will perform the conversion</summary>
''' <param name="instance"></param>
''' <param name="argc"></param>
''' <param name="argv"></param>
''' <returns></returns>
<DllImport("gsdll32.dll", EntryPoint:="gsapi_init_with_args")> _
Private Shared Function gsapi_init_with_args(ByVal instance As IntPtr, ByVal argc As Integer, ByVal argv As IntPtr) As Integer
End Function
''' <summary>
''' Exit the interpreter. This must be called on shutdown if gsapi_init_with_args() has been called, and just before gsapi_delete_instance().
''' </summary>
''' <param name="instance"></param>
''' <returns></returns>
<DllImport("gsdll32.dll", EntryPoint:="gsapi_exit")> _
Private Shared Function gsapi_exit(ByVal instance As IntPtr) As Integer
End Function
''' <summary>
''' Destroy an instance of Ghostscript. Before you call this, Ghostscript must have finished. If Ghostscript has been initialised, you must call gsapi_exit before gsapi_delete_instance.
''' </summary>
''' <param name="instance"></param>
<DllImport("gsdll32.dll", EntryPoint:="gsapi_delete_instance")> _
Private Shared Sub gsapi_delete_instance(ByVal instance As IntPtr)
End Sub
''' <summary>Get info about the version of Ghostscript i'm using</summary>
''' <param name="pGSRevisionInfo"></param>
''' <param name="intLen"></param>
''' <returns></returns>
<DllImport("gsdll32.dll", EntryPoint:="gsapi_revision")> _
Private Shared Function gsapi_revision(ByRef pGSRevisionInfo As GS_Revision, ByVal intLen As Integer) As Integer
End Function
''' <summary>Use a different I/O</summary>
''' <param name="lngGSInstance"></param>
''' <param name="gsdll_stdin">Function that menage the Standard INPUT</param>
''' <param name="gsdll_stdout">Function that menage the Standard OUTPUT</param>
''' <param name="gsdll_stderr">Function that menage the Standard ERROR output</param>
''' <returns></returns>
<DllImport("gsdll32.dll", EntryPoint:="gsapi_set_stdio")> _
Private Shared Function gsapi_set_stdio(ByVal lngGSInstance As IntPtr, ByVal gsdll_stdin As StdioCallBack, ByVal gsdll_stdout As StdioCallBack, ByVal gsdll_stderr As StdioCallBack) As Integer
End Function
#End Region
#Region "Const"
Const e_Quit As Integer = -101
Const e_NeedInput As Integer = -106
Const BW_TIFF_G4 As String = "tiffg4"
Const BW_TIFF_LZW As String = "tifflzw"
Const GRAY_TIFF_NC As String = "tiffgray"
Const GRAY_PNG = "pnggray"
Const GRAY_JPG = "jpeggray"
Const COLOR_TIFF_RGB As String = "tiff24nc"
Const COLOR_TIFF_CMYK As String = "tiff32nc"
Const COLOR_TIFF_CMYK_SEP As String = "tiffsep"
Const COLOR_PNG_RGB As String = "png16m"
Const COLOR_JPEG = "jpeg"
Const PRINT_DPI As Integer = 300
Const VIEW_DPI As Integer = 200
#End Region
#Region "Variables"
Private _sDeviceFormat As String
Private _sParametersUsed As String
Private _iWidth As Integer
Private _iHeight As Integer
Private _iResolutionX As Integer
Private _iResolutionY As Integer
Private _iJPEGQuality As Integer
Private _iMaxBitmap As Integer = 0
Private _iMaxBuffer As Integer = 0
Private _sUserPassword As String
''' <summary>The first page to convert in image</summary>
Private _iFirstPageToConvert As Integer = -1
''' <summary>The last page to conver in an image</summary>
Private _iLastPageToConvert As Integer = -1
''' <summary>This parameter is used to control subsample antialiasing of graphics</summary>
Private _iGraphicsAlphaBit As Integer = -1
''' <summary>This parameter is used to control subsample antialiasing of text</summary>
Private _iTextAlphaBit As Integer = -1
''' <summary>In how many thread i should perform the conversion</summary>
''' <remarks>This is a Major innovation since 8.63 NEVER use it with previous version!</remarks>
Private _iRenderingThreads As Integer = -1
''' <summary>In how many thread i should perform the conversion</summary>
''' <remarks>This is a Major innovation since 8.63 NEVER use it with previous version!</remarks>
''' <value>Set it to 0 made the program set it to Environment.ProcessorCount HT machine could want to perform a check for this..</value>
Public Property RenderingThreads() As Integer
Get
Return _iRenderingThreads
End Get
Set(ByVal value As Integer)
If value = 0 Then
_iRenderingThreads = Environment.ProcessorCount
Else
_iRenderingThreads = value
End If
End Set
End Property
Private _bFitPage As Boolean
Private _bThrowOnlyException As Boolean = False
Private _bRedirectIO As Boolean = False
Private _bForcePageSize As Boolean = False
''' <summary>The pagesize of the output</summary>
Private _sDefaultPageSize As String
Private _objHandle As IntPtr
''' <summary>If true i will try to output everypage to a different file!</summary>
Private _didOutputToMultipleFile As Boolean = False
Private myProcess As System.Diagnostics.Process
Public output As StringBuilder
'public string output;
'private List<byte> outputBytes;
'public string error;
#End Region
#Region "Proprieties"
''' <summary>
''' What format to use to convert
''' is suggested to use png256 instead of jpeg for document!
''' they are smaller and better suited!
''' </summary>
Public Property OutputFormat() As String
Get
Return _sDeviceFormat
End Get
Set(ByVal value As String)
_sDeviceFormat = value
End Set
End Property
''' <summary>The pagesize of the output</summary>
''' <remarks>Without this parameter the output should be letter, complain to USA for this :) if the document specify a different size it will take precedece over this!</remarks>
Public Property DefaultPageSize() As String
Get
Return _sDefaultPageSize
End Get
Set(ByVal value As String)
_sDefaultPageSize = value
End Set
End Property
''' <summary>If set to true and page default page size will force the rendering in that output format</summary>
Public Property ForcePageSize() As Boolean
Get
Return _bForcePageSize
End Get
Set(ByVal value As Boolean)
_bForcePageSize = value
End Set
End Property
Public Property ParametersUsed() As String
Get
Return _sParametersUsed
End Get
Set(ByVal value As String)
_sParametersUsed = value
End Set
End Property
Public Property Width() As Integer
Get
Return _iWidth
End Get
Set(ByVal value As Integer)
_iWidth = value
End Set
End Property
Public Property Height() As Integer
Get
Return _iHeight
End Get
Set(ByVal value As Integer)
_iHeight = value
End Set
End Property
Public Property MaxBitmap() As Integer
Get
Return _iMaxBitmap
End Get
Set(ByVal value As Integer)
_iMaxBitmap = value
End Set
End Property
Public Property MaxBuffer() As Integer
Get
Return _iMaxBuffer
End Get
Set(ByVal value As Integer)
_iMaxBuffer = value
End Set
End Property
Public Property UserPassword() As String
Get
Return _sUserPassword
End Get
Set(ByVal value As String)
_sUserPassword = value
End Set
End Property
Public Property ResolutionX() As Integer
Get
Return _iResolutionX
End Get
Set(ByVal value As Integer)
_iResolutionX = value
End Set
End Property
Public Property ResolutionY() As Integer
Get
Return _iResolutionY
End Get
Set(ByVal value As Integer)
_iResolutionY = value
End Set
End Property
''' <summary>This parameter is used to control subsample antialiasing of graphics</summary>
''' <value>Value MUST BE below or equal 0 if not set, or 1,2,or 4 NO OTHER VALUES!</value>
Public Property GraphicsAlphaBit() As Integer
Get
Return _iGraphicsAlphaBit
End Get
Set(ByVal value As Integer)
If (value > 4) Or (value = 3) Then
Throw New ArgumentOutOfRangeException("The Graphics Alpha Bit must have a value between 1 2 and 4, or <= 0 if not set")
End If
_iGraphicsAlphaBit = value
End Set
End Property
''' <summary>This parameter is used to control subsample antialiasing of text</summary>
''' <value>Value MUST BE below or equal 0 if not set, or 1,2,or 4 NO OTHER VALUES!</value>
Public Property TextAlphaBit() As Integer
Get
Return _iTextAlphaBit
End Get
Set(ByVal value As Integer)
If (value > 4) Or (value = 3) Then
Throw New ArgumentOutOfRangeException("The Text ALpha Bit must have a value between 1 2 and 4, or <= 0 if not set")
End If
_iTextAlphaBit = value
End Set
End Property
Public Property FitPage() As [Boolean]
Get
Return _bFitPage
End Get
Set(ByVal value As [Boolean])
_bFitPage = value
End Set
End Property
''' <summary>Quality of compression of JPG</summary>
Public Property JPEGQuality() As Integer
Get
Return _iJPEGQuality
End Get
Set(ByVal value As Integer)
_iJPEGQuality = value
End Set
End Property
''' <summary>The first page to convert in image</summary>
Public Property FirstPageToConvert() As Integer
Get
Return _iFirstPageToConvert
End Get
Set(ByVal value As Integer)
_iFirstPageToConvert = value
End Set
End Property
''' <summary>The last page to conver in an image</summary>
Public Property LastPageToConvert() As Integer
Get
Return _iLastPageToConvert
End Get
Set(ByVal value As Integer)
_iLastPageToConvert = value
End Set
End Property
''' <summary>Set to True if u want the program to never display Messagebox
''' but otherwise throw exception</summary>
Public Property ThrowOnlyException() As [Boolean]
Get
Return _bThrowOnlyException
End Get
Set(ByVal value As [Boolean])
_bThrowOnlyException = value
End Set
End Property
''' <summary>If i should redirect the Output of Ghostscript library somewhere</summary>
Public Property RedirectIO() As Boolean
Get
Return _bRedirectIO
End Get
Set(ByVal value As Boolean)
_bRedirectIO = value
End Set
End Property
''' <summary>If true i will try to output everypage to a different file!</summary>
Public Property OutputToMultipleFile() As Boolean
Get
Return _didOutputToMultipleFile
End Get
Set(ByVal value As Boolean)
_didOutputToMultipleFile = value
End Set
End Property
#End Region
#Region "Init"
Public Sub New(ByVal objHandle As IntPtr)
_objHandle = objHandle
End Sub
Public Sub New()
_objHandle = IntPtr.Zero
End Sub
#End Region
#Region "Convert"
''' <summary>Convert a single file!</summary>
''' <param name="inputFile">The file PDf to convert</param>
''' <param name="outputFile">The image file that will be created</param>
''' <remarks>You must pass all the parameter for the conversion
''' as Proprieties of this class</remarks>
''' <returns>True if the conversion succed!</returns>
Public Function Convert(ByVal inputFile As String, ByVal outputFile As String) As Boolean
Return Convert(inputFile, outputFile, _bThrowOnlyException, Nothing)
End Function
''' <summary>Convert a single file!</summary>
''' <param name="inputFile">The file PDf to convert</param>
''' <param name="outputFile">The image file that will be created</param>
''' <param name="parameters">You must pass all the parameter for the conversion here</param>
''' <remarks>Thanks to tchu_2000 for the help!</remarks>
''' <returns>True if the conversion succed!</returns>
Public Function Convert(ByVal inputFile As String, ByVal outputFile As String, ByVal parameters As String) As Boolean
Return Convert(inputFile, outputFile, _bThrowOnlyException, parameters)
End Function
''' <summary>Convert a single file!</summary>
''' <param name="inputFile">The file PDf to convert</param>
''' <param name="outputFile">The image file that will be created</param>
''' <param name="throwException">if the function should throw an exception
''' or display a message box</param>
''' <remarks>You must pass all the parameter for the conversion
''' as Proprieties of this class</remarks>
''' <returns>True if the conversion succed!</returns>
Private Function Convert(ByVal inputFile As String, ByVal outputFile As String, ByVal throwException As Boolean, ByVal options As String) As Boolean
'#Region "Check Input"
'Avoid to work when the file doesn't exist
If String.IsNullOrEmpty(inputFile) Then
If throwException Then
Throw New ArgumentNullException("inputFile")
Else
System.Windows.Forms.MessageBox.Show("The inputfile is missing")
Return False
End If
End If
If Not System.IO.File.Exists(inputFile) Then
If throwException Then
Throw New ArgumentException(String.Format("The file :'{0}' doesn't exist", inputFile), "inputFile")
Else
System.Windows.Forms.MessageBox.Show(String.Format("The file :'{0}' doesn't exist", inputFile))
Return False
End If
End If
If String.IsNullOrEmpty(_sDeviceFormat) Then
If throwException Then
Throw New ArgumentNullException("Device")
Else
System.Windows.Forms.MessageBox.Show("You didn't provide a device for the conversion")
Return False
End If
End If
'be sure that if i specify multiple page outpage i added the % to the filename!
'#End Region
'#Region "Variables"
Dim intReturn As Integer, intCounter As Integer, intElementCount As Integer
'The pointer to the current istance of the dll
Dim intGSInstanceHandle As IntPtr
Dim aAnsiArgs As Object()
Dim aPtrArgs As IntPtr()
Dim aGCHandle As GCHandle()
Dim callerHandle As IntPtr, intptrArgs As IntPtr
Dim gchandleArgs As GCHandle
'#End Region
'Generate the list of the parameters i need to pass to the dll
Dim sArgs As String() = GetGeneratedArgs(inputFile, outputFile, options)
'#Region "Convert Unicode strings to null terminated ANSI byte arrays"
' Convert the Unicode strings to null terminated ANSI byte arrays
' then get pointers to the byte arrays.
intElementCount = sArgs.Length
aAnsiArgs = New Object(intElementCount - 1) {}
aPtrArgs = New IntPtr(intElementCount - 1) {}
aGCHandle = New GCHandle(intElementCount - 1) {}
'Convert the parameters
For intCounter = 0 To intElementCount - 1
aAnsiArgs(intCounter) = StringToAnsiZ(sArgs(intCounter))
aGCHandle(intCounter) = GCHandle.Alloc(aAnsiArgs(intCounter), GCHandleType.Pinned)
aPtrArgs(intCounter) = aGCHandle(intCounter).AddrOfPinnedObject()
Next
gchandleArgs = GCHandle.Alloc(aPtrArgs, GCHandleType.Pinned)
intptrArgs = gchandleArgs.AddrOfPinnedObject()
'#End Region
'#Region "Create a new istance of the library!"
intReturn = -1
Try
intReturn = gsapi_new_instance(intGSInstanceHandle, _objHandle)
'Be sure that we create an istance!
If intReturn < 0 Then
ClearParameters(aGCHandle, gchandleArgs)
If throwException Then
Throw New ApplicationException("I can't create a new istance of Ghostscript please verify no other istance are running!")
Else
System.Windows.Forms.MessageBox.Show("I can't create a new istance of Ghostscript please verify no other istance are running!")
Return False
End If
End If
Catch ex As DllNotFoundException
'in this case the dll we r using isn't the dll we expect
ClearParameters(aGCHandle, gchandleArgs)
If throwException Then
Throw New ApplicationException("The gsdll32.dll wasn't found in default dlls search path" & "or is not in correct version (doesn't expose the required methods). Please download " & "the version 8.64 from the original website")
Else
'Barbara post write much better then me, thanks her for the nice words :P
System.Windows.Forms.MessageBox.Show("The gsdll32.dll wasn't found in default dlls search path" & "or is not in correct version (doesn't expose the required methods). Please download " & "the version 8.64 from the original website")
Return False
End If
End Try
callerHandle = IntPtr.Zero
'remove unwanter handler
'#End Region
'#Region "Capture the I/O"
If (_bRedirectIO) Then
Dim stdinCallback As StdioCallBack
stdinCallback = AddressOf gsdll_stdin
Dim stdoutCallback As StdioCallBack
stdoutCallback = AddressOf gsdll_stdout
Dim stderrCallback As StdioCallBack
stderrCallback = AddressOf gsdll_stderr
intReturn = gsapi_set_stdio(intGSInstanceHandle, stdinCallback, stdoutCallback, stderrCallback)
If output Is Nothing Then
output = New StringBuilder()
Else
output.Remove(0, output.Length)
End If
myProcess = System.Diagnostics.Process.GetCurrentProcess()
AddHandler myProcess.OutputDataReceived, AddressOf SaveOutputToImage
End If
'#End Region
intReturn = -1
'if nothing change it there is an error!
'Ok now is time to call the interesting method
Try
intReturn = gsapi_init_with_args(intGSInstanceHandle, intElementCount, intptrArgs)
Catch ex As Exception
If throwException Then
Throw New ApplicationException(ex.Message, ex)
Else
System.Windows.Forms.MessageBox.Show(ex.Message)
End If
Finally
'No matter what happen i MUST close the istance!
'free all the memory
ClearParameters(aGCHandle, gchandleArgs)
gsapi_exit(intGSInstanceHandle)
'Close the istance
gsapi_delete_instance(intGSInstanceHandle)
'delete it
'In case i was looking for output now stop
If myProcess IsNot Nothing Then
RemoveHandler myProcess.OutputDataReceived, AddressOf SaveOutputToImage
End If
End Try
'Conversion was successfull if return code was 0 or e_Quit
'e_Quit = -101
Return (intReturn = 0) Or (intReturn = e_Quit)
End Function
''' <summary>Remove the memory allocated</summary>
''' <param name="aGCHandle"></param>
''' <param name="gchandleArgs"></param>
Private Sub ClearParameters(ByRef aGCHandle As GCHandle(), ByRef gchandleArgs As GCHandle)
For intCounter As Integer = 0 To aGCHandle.Length - 1
aGCHandle(intCounter).Free()
Next
gchandleArgs.Free()
End Sub
#Region "Test (code not used)"
Private Sub SaveOutputToImage(ByVal sender As Object, ByVal e As System.Diagnostics.DataReceivedEventArgs)
output.Append(e.Data)
End Sub
Public Function Convert(ByVal inputFile As String) As System.Drawing.Image
_bRedirectIO = True
If Convert(inputFile, "%stdout", _bThrowOnlyException) Then
If (output IsNot Nothing) AndAlso (output.Length > 0) Then
'StringReader sr = new StringReader(output.ToString());
'MemoryStream ms = new MemoryStream(UTF8Encoding.Default.GetBytes(output.ToString()));
Dim returnImage As System.Drawing.Image = TryCast(System.Drawing.Image.FromStream(myProcess.StandardOutput.BaseStream).Clone(), System.Drawing.Image)
'ms.Close();
Return returnImage
End If
End If
Return Nothing
End Function
#End Region
#End Region
#Region "Accessory Functions"
''' <summary>This function create the list of parameters to pass to the dll with parameters given directly from the program</summary>
''' <param name="inputFile"></param>
''' <param name="outputFile"></param>
''' <param name="otherParameters">The other parameters i could be interested</param>
''' <remarks>Be very Cautious using this! code provided and modified from tchu_2000</remarks>
''' <returns></returns>
Private Function GetGeneratedArgs(ByVal inputFile As String, ByVal outputFile As String, ByVal otherParameters As String) As String()
If Not String.IsNullOrEmpty(otherParameters) Then
Return GetGeneratedArgs(inputFile, outputFile, otherParameters.Split(New String() {" "}, StringSplitOptions.RemoveEmptyEntries))
Else
Return GetGeneratedArgs(inputFile, outputFile, DirectCast(Nothing, String()))
End If
End Function
''' <summary>This function create the list of parameters to pass to the dll</summary>
''' <param name="inputFile">the file to convert</param>
''' <param name="outputFile">where to write the image</param>
''' <returns>the list of the arguments</returns>
Private Function GetGeneratedArgs(ByVal inputFile As String, ByVal outputFile As String, ByVal presetParameters As String()) As String()
Dim args As String()
Dim lstExtraArgs As New ArrayList()
'ok if i haven't been passed a list of parameters create my own
If (presetParameters Is Nothing) OrElse (presetParameters.Length = 0) Then
'Ok now check argument per argument and compile them
'If i want a jpeg i can set also quality
If _sDeviceFormat = "jpeg" AndAlso _iJPEGQuality > 0 AndAlso _iJPEGQuality < 101 Then
lstExtraArgs.Add(String.Format(GS_JpegQualityFormat, _iJPEGQuality))
End If
'if i provide size it will override the paper size
If _iWidth > 0 AndAlso _iHeight > 0 Then
lstExtraArgs.Add(String.Format(GS_PageSizeFormat, _iWidth, _iHeight))
Else
'otherwise if aviable use the papersize
If Not String.IsNullOrEmpty(_sDefaultPageSize) Then
lstExtraArgs.Add(String.Format(GS_DefaultPaperSize, _sDefaultPageSize))
'It have no meaning to set it if the default page is not set!
If _bForcePageSize Then
lstExtraArgs.Add(GS_FixedMedia)
End If
End If
End If
'not set antialiasing settings
If _iGraphicsAlphaBit > 0 Then
lstExtraArgs.Add(String.Format(GS_GraphicsAlphaBits, _iGraphicsAlphaBit))
End If
If _iTextAlphaBit > 0 Then
lstExtraArgs.Add(String.Format(GS_TextAlphaBits, _iTextAlphaBit))
End If
'Should i try to fit?
If _bFitPage Then
lstExtraArgs.Add(GS_FitPage)
End If
'Should I try to speed up rendering?
If _iMaxBitmap > 0 Then
lstExtraArgs.Add([String].Format(GS_MaxBitmap, _iMaxBitmap))
End If
If _iMaxBuffer > 0 Then
lstExtraArgs.Add([String].Format(GS_BufferSpace, _iMaxBuffer))
End If
'Password
If _sUserPassword <> "" Then
lstExtraArgs.Add([String].Format(GS_Password, _sUserPassword))
End If
'Do i have a forced resolution?
If _iResolutionX > 0 Then
If _iResolutionY > 0 Then
lstExtraArgs.Add([String].Format(GS_ResolutionXYFormat, _iResolutionX, _iResolutionY))
Else
lstExtraArgs.Add([String].Format(GS_ResolutionXFormat, _iResolutionX))
End If
End If
If _iFirstPageToConvert > 0 Then
lstExtraArgs.Add([String].Format(GS_FirstPageFormat, _iFirstPageToConvert))
End If
If _iLastPageToConvert > 0 Then
If (_iFirstPageToConvert > 0) AndAlso (_iFirstPageToConvert > _iLastPageToConvert) Then
Throw New ArgumentOutOfRangeException(String.Format("The 1st page to convert ({0}) can't be after then the last one ({1})", _iFirstPageToConvert, _iLastPageToConvert))
End If
lstExtraArgs.Add([String].Format(GS_LastPageFormat, _iLastPageToConvert))
End If
'Set in how many threads i want to do the work
If _iRenderingThreads > 0 Then
lstExtraArgs.Add([String].Format(GS_RenderingThreads, _iRenderingThreads))
End If
'If i want to redirect write it to the standard output!
If _bRedirectIO Then
'In this case you must also use the -q switch to prevent Ghostscript
'from writing messages to standard output which become
'mixed with the intended output stream.
outputFile = GS_StandardOutputDevice
lstExtraArgs.Add(GS_QuiteOperation)
End If
Dim iFixedCount As Integer = 7
'This are the mandatory options
Dim iExtraArgsCount As Integer = lstExtraArgs.Count
args = New String(iFixedCount + (lstExtraArgs.Count - 1)) {}
args(1) = GS_Fixed1stParameter
'"-dNOPAUSE";//I don't want interruptions
args(2) = GS_Fixed2ndParameter
'"-dBATCH";//stop after
args(3) = GS_Fixed3rdParameter
'"-dSAFER";
args(4) = String.Format(GS_DeviceFormat, _sDeviceFormat)
'what kind of export format i should provide
'For a complete list watch here:
'http://pages.cs.wisc.edu/~ghost/doc/cvs/Devices.htm
'Fill the remaining parameters
For i As Integer = 0 To iExtraArgsCount - 1
args(5 + i) = DirectCast(lstExtraArgs(i), String)
Next
Else
'3 arguments MUST be added 0 (meaningless) and at the end the output and the inputfile
args = New String(presetParameters.Length + 2) {}
'now use the parameters i receive (thanks CrucialBT to point this out!)
For i As Integer = 1 To presetParameters.Length - 1
args(i) = presetParameters(i - 1)
Next
End If
args(0) = GS_FirstParameter
'this parameter have little real use
'Now check if i want to update to 1 file per page i have to be sure do add % to the output filename
If (_didOutputToMultipleFile) AndAlso (Not outputFile.Contains(GS_MultiplePageCharacter)) Then
' Thanks to Spillie to show me the error!
Dim lastDotIndex As Integer = outputFile.LastIndexOf("."c)
If lastDotIndex > 0 Then
outputFile = outputFile.Insert(lastDotIndex, "%d")
End If
End If
'Ok now save them to be shown 4 debug use
_sParametersUsed = String.Empty
'Copy all the args except the 1st that is useless and the last 2
For i As Integer = 1 To args.Length - 3
_sParametersUsed += " " & args(i)
Next
'Fill outputfile and inputfile as last 2 arguments!
args(args.Length - 2) = String.Format(GS_OutputFileFormat, outputFile)
args(args.Length - 1) = String.Format("{0}", inputFile)
_sParametersUsed += (" " & String.Format(GS_OutputFileFormat, String.Format("""{0}""", outputFile)) & " ") + String.Format("""{0}""", inputFile)
Return args
End Function
''' <summary>
''' Convert a Unicode string to a null terminated Ansi string for Ghostscript.
''' The result is stored in a byte array
''' </summary>
''' <param name="str">The parameter i want to convert</param>
''' <returns>the byte array that contain the string</returns>
Private Shared Function StringToAnsiZ(ByVal str As String) As Byte()
' Later you will need to convert
' this byte array to a pointer with
' GCHandle.Alloc(XXXX, GCHandleType.Pinned)
' and GSHandle.AddrOfPinnedObject()
'int intElementCount,intCounter;
'This with Encoding.Default should work also with Chineese Japaneese
'Thanks to tchu_2000 I18N related patch
If str Is Nothing Then
str = [String].Empty
End If
Return Encoding.[Default].GetBytes(str)
End Function
''' <summary>Convert a Pointer to a string to a real string</summary>
''' <param name="strz">the pointer to the string in memory</param>
''' <returns>The string</returns>
Public Shared Function AnsiZtoString(ByVal strz As IntPtr) As String
If strz <> IntPtr.Zero Then
Return Marshal.PtrToStringAnsi(strz)
Else
Return String.Empty
End If
End Function
#End Region
#Region "Menage Standard Input & Standard Output"
Public Function gsdll_stdin(ByVal intGSInstanceHandle As IntPtr, ByVal strz As IntPtr, ByVal intBytes As Integer) As Integer
' This is dumb code that reads one byte at a time
' Ghostscript doesn't mind this, it is just very slow
'If intBytes = 0 Then
' Return 0
'Else
' Dim ich As Integer = Console.Read()
' If ich = -1 Then
' Return 0
' Else
' ' EOF
' Dim bch As Byte = CByte(ich)
' Dim gcByte As GCHandle = GCHandle.Alloc(bch, GCHandleType.Pinned)
' Dim ptrByte As IntPtr = gcByte.AddrOfPinnedObject()
' CopyMemory(strz, ptrByte, 1)
' ptrByte = IntPtr.Zero
' gcByte.Free()
' Return 1
' End If
'End If
End Function
Public Function gsdll_stdout(ByVal intGSInstanceHandle As IntPtr, ByVal strz As IntPtr, ByVal intBytes As Integer) As Integer
If intBytes > 0 Then
'Console.Write(Marshal.PtrToStringAnsi(strz))
End If
Return 0
End Function
Public Function gsdll_stderr(ByVal intGSInstanceHandle As IntPtr, ByVal strz As IntPtr, ByVal intBytes As Integer) As Integer
'return gsdll_stdout(intGSInstanceHandle, strz, intBytes);
'Console.Write(Marshal.PtrToStringAnsi(strz))
Return intBytes
End Function
#End Region
#Region "Menage Revision"
Public Function GetRevision() As GhostScriptRevision
' Check revision number of Ghostscript
Dim intReturn As Integer
Dim udtGSRevInfo As New GS_Revision()
Dim output As GhostScriptRevision
Dim gcRevision As GCHandle
gcRevision = GCHandle.Alloc(udtGSRevInfo, GCHandleType.Pinned)
intReturn = gsapi_revision(udtGSRevInfo, 16)
output.intRevision = udtGSRevInfo.intRevision
output.intRevisionDate = udtGSRevInfo.intRevisionDate
output.ProductInformation = AnsiZtoString(udtGSRevInfo.strProduct)
output.CopyrightInformations = AnsiZtoString(udtGSRevInfo.strCopyright)
gcRevision.Free()
Return output
End Function
#End Region
#Region "Simple Conversion Functions"
Public Shared Function ConvertPdfToGraphic(ByVal inputFileName As String, _
ByVal outputFileName As String, _
ByVal fileFormat As String, _
ByVal DPI As Integer, _
Optional ByVal startPageNumber As Integer = 0, _
Optional ByVal endPageNumber As Integer = 0, _
Optional ByVal ToPrinter As Boolean = False, _
Optional ByVal Password As String = "" _
) As String
ConvertPdfToGraphic = ""
Dim converter As New ConvertPDF.PDFConvert
Dim Converted As Boolean = False
converter.RenderingThreads = Environment.ProcessorCount
If fileFormat.Contains("tif") Then
converter.OutputToMultipleFile = False
Else
converter.OutputToMultipleFile = True
End If
If startPageNumber = 0 Then
converter.FirstPageToConvert = -1
converter.LastPageToConvert = -1
Else
converter.FirstPageToConvert = startPageNumber
converter.LastPageToConvert = endPageNumber
End If
converter.FitPage = False
converter.JPEGQuality = 70
If ToPrinter = True Then 'Turn off anti-aliasing
converter.TextAlphaBit = -1
converter.GraphicsAlphaBit = -1
Else 'Turn on anti-aliasing
converter.TextAlphaBit = 4
converter.GraphicsAlphaBit = 4
End If
converter.ResolutionX = DPI
converter.ResolutionY = DPI
converter.OutputFormat = fileFormat
converter.UserPassword = Password
Dim input As System.IO.FileInfo = New FileInfo(inputFileName)
'If the output file exists already, be sure to add a random name at the end until it is unique
While File.Exists(outputFileName)
Dim suffix As String = System.Text.RegularExpressions.Regex.Replace(outputFileName, "^.+\.(.+$)", "$1")
outputFileName = outputFileName.Replace("." & suffix, "(" & Now.Ticks & ")." & suffix)
End While
Converted = converter.Convert(input.FullName, outputFileName)
If Converted Then
ConvertPdfToGraphic = outputFileName
Else
ConvertPdfToGraphic = ""
End If
End Function
Public Shared Function GetPageFromPDF(ByVal filename As String, ByVal PageNumber As Integer, Optional ByVal DPI As Integer = VIEW_DPI, Optional ByVal Password As String = "", Optional ByVal forPrinting As Boolean = False) As System.Drawing.Image
Dim converter As New ConvertPDF.PDFConvert
Dim Converted As Boolean = False
converter.RenderingThreads = Environment.ProcessorCount
converter.OutputToMultipleFile = False
converter.MaxBitmap = 100000000 '100 MB
converter.MaxBuffer = 200000000 '200 MB
If PageNumber > 0 Then
converter.FirstPageToConvert = PageNumber
converter.LastPageToConvert = PageNumber
Else
GetPageFromPDF = Nothing
Exit Function
End If
converter.FitPage = False
converter.JPEGQuality = 70
converter.UserPassword = Password
If DPI <> VIEW_DPI Then 'Custom resolution
converter.ResolutionX = DPI
converter.ResolutionY = DPI
Else ' Default resolution
converter.ResolutionX = VIEW_DPI
converter.ResolutionY = VIEW_DPI
End If
If forPrinting Then 'Turn off anti-aliasing (crisp edges)
converter.TextAlphaBit = -1
converter.GraphicsAlphaBit = -1
Else 'Turn on anti-aliasing (smooth edges)
converter.TextAlphaBit = 4
converter.GraphicsAlphaBit = 4
End If
converter.OutputFormat = COLOR_PNG_RGB
Dim output As String = System.IO.Path.GetTempPath & Now.Ticks & ".png"
Converted = converter.Convert(filename, output)
If Converted Then
GetPageFromPDF = New Bitmap(output)
ImageUtil.DeleteFile(output)
Else
GetPageFromPDF = Nothing
End If
End Function
#End Region
End Class
''' <summary>Delegate used by Ghostscript to perform I/O operations</summary>
''' <param name="handle"></param>
''' <param name="strptr"></param>
''' <param name="count"></param>
''' <returns></returns>
Public Delegate Function StdioCallBack(ByVal handle As IntPtr, ByVal strptr As IntPtr, ByVal count As Integer) As Integer
''' <summary>This struct is filled with the information of the version of this ghostscript</summary>
''' <remarks>Have the layout defined cuz i will fill it with a kernel copy memory</remarks>
<StructLayout(LayoutKind.Sequential)> _
Structure GS_Revision
Public strProduct As IntPtr
Public strCopyright As IntPtr
Public intRevision As Integer
Public intRevisionDate As Integer
End Structure
Public Structure GhostScriptRevision
Public ProductInformation As String
Public CopyrightInformations As String
Public intRevision As Integer
Public intRevisionDate As Integer
End Structure
End Namespace

View File

@@ -0,0 +1,390 @@
Imports System.Drawing.Imaging
Imports System
Imports System.Drawing
Imports System.Runtime.InteropServices
Imports System.IO
Imports System.Drawing.Drawing2D
Imports System.Text.RegularExpressions
Imports System.Windows.Forms
Public Class ImageUtil
Public Shared Function MakeGrayscale(ByVal original As System.Drawing.Bitmap) As System.Drawing.Bitmap
'create a blank bitmap the same size as original
Dim newBitmap As New System.Drawing.Bitmap(original.Width, original.Height)
'get a graphics object from the new image
Dim g As Graphics = Graphics.FromImage(newBitmap)
'create the grayscale ColorMatrix
Dim colorMatrix As New ColorMatrix(New Single()() {New Single() {0.3, 0.3, 0.3, 0, 0}, New Single() {0.59, 0.59, 0.59, 0, 0}, New Single() {0.11, 0.11, 0.11, 0, 0}, New Single() {0, 0, 0, 1, 0}, New Single() {0, 0, 0, 0, 1}})
'create some image attributes
Dim attributes As New ImageAttributes()
'set the color matrix attribute
attributes.SetColorMatrix(colorMatrix)
'draw the original image on the new image
'using the grayscale color matrix
g.DrawImage(original, New Rectangle(0, 0, original.Width, original.Height), 0, 0, original.Width, original.Height, _
GraphicsUnit.Pixel, attributes)
'dispose the Graphics object
g.Dispose()
Return newBitmap
End Function
Public Shared Function BitmapTo1Bpp(ByVal img As System.Drawing.Bitmap) As System.Drawing.Bitmap
If img.PixelFormat <> PixelFormat.Format32bppPArgb Then
Dim temp As New System.Drawing.Bitmap(img.Width, img.Height, PixelFormat.Format32bppPArgb)
Dim g As Graphics = Graphics.FromImage(temp)
g.DrawImage(img, New Rectangle(0, 0, img.Width, img.Height), 0, 0, img.Width, img.Height, GraphicsUnit.Pixel)
img.Dispose()
g.Dispose()
img = temp
End If
Dim imageTemp As System.Drawing.Image
imageTemp = img
'lock the bits of the original bitmap
Dim bmdo As BitmapData = img.LockBits(New Rectangle(0, 0, img.Width, img.Height), ImageLockMode.ReadOnly, img.PixelFormat)
'and the new 1bpp bitmap
Dim bm As New System.Drawing.Bitmap(imageTemp.Width, imageTemp.Height, PixelFormat.Format1bppIndexed)
Dim bmdn As BitmapData = bm.LockBits(New Rectangle(0, 0, bm.Width, bm.Height), ImageLockMode.ReadWrite, PixelFormat.Format1bppIndexed)
'for diagnostics
Dim dt As DateTime = DateTime.Now
'scan through the pixels Y by X
Dim y As Integer
For y = 0 To img.Height - 1
Dim x As Integer
For x = 0 To img.Width - 1
'generate the address of the colour pixel
Dim index As Integer = y * bmdo.Stride + x * 4
'check its brightness
If Color.FromArgb(Marshal.ReadByte(bmdo.Scan0, index + 2), Marshal.ReadByte(bmdo.Scan0, index + 1), Marshal.ReadByte(bmdo.Scan0, index)).GetBrightness() > 0.5F Then
Dim imgUtil As New ImageUtil
imgUtil.SetIndexedPixel(x, y, bmdn, True) 'set it if its bright.
End If
Next x
Next y
'tidy up
bm.UnlockBits(bmdn)
img.UnlockBits(bmdo)
imageTemp = Nothing
'display the 1bpp image.
Return bm
End Function
Public Shared Sub ScaleImage(ByRef img As Drawing.Image, ByVal scale_factor As Single)
Dim bm_source As New Drawing.Bitmap(img)
Dim bm_dest As New Drawing.Bitmap( _
CInt(bm_source.Width * scale_factor), _
CInt(bm_source.Height * scale_factor))
Dim gr_dest As Graphics = Graphics.FromImage(bm_dest)
gr_dest.DrawImage(bm_source, 0, 0, _
bm_dest.Width + 1, _
bm_dest.Height + 1)
bm_source = Nothing
gr_dest.Dispose()
img = bm_dest
End Sub
Public Shared Sub ScaleImageToPicBox(ByRef oPict As PictureBox, ByRef img As Drawing.Image)
Dim xPercent As Single = oPict.Width / img.Width
Dim yPercent As Single = oPict.Height / img.Height
Dim scalePercent As Single = 0
If xPercent > yPercent Then
scalePercent = yPercent
Else
scalePercent = xPercent
End If
ScaleImage(img, scalePercent)
End Sub
Public Shared Sub RotateImageClockwise(ByRef pPicBox As PictureBox)
pPicBox.Image.RotateFlip(RotateFlipType.Rotate90FlipNone)
FlipDimensions(pPicBox)
RecalcPageLocation(pPicBox)
pPicBox.Refresh()
End Sub
Public Shared Sub RotateImageCounterclockwise(ByRef pPicBox As PictureBox)
pPicBox.Image.RotateFlip(RotateFlipType.Rotate270FlipNone)
FlipDimensions(pPicBox)
RecalcPageLocation(pPicBox)
pPicBox.Refresh()
End Sub
Public Shared Sub FlipDimensions(ByRef pPicbox As PictureBox)
Dim height As Integer = pPicbox.Height
Dim width As Integer = pPicbox.Width
pPicbox.Height = width
pPicbox.Width = height
End Sub
Public Shared Sub ApplyRotation(ByRef img As Drawing.Image, ByVal numberOfRotations As Integer)
If numberOfRotations < 0 Then
For i As Integer = 1 To Math.Abs(numberOfRotations)
img.RotateFlip(RotateFlipType.Rotate270FlipNone)
Next
End If
If numberOfRotations > 0 Then
For i As Integer = 1 To numberOfRotations
img.RotateFlip(RotateFlipType.Rotate90FlipNone)
Next
End If
End Sub
Public Shared Sub PictureBoxZoomActual(ByRef pPicBox As PictureBox)
If Not Nothing Is pPicBox And Not Nothing Is pPicBox.Image Then
pPicBox.Width = pPicBox.Image.Width
pPicBox.Height = pPicBox.Image.Height
End If
End Sub
Public Shared Sub PictureBoxZoomPageWidth(ByRef pPicBox As PictureBox)
If Not Nothing Is pPicBox And Not Nothing Is pPicBox.Parent Then
pPicBox.Width = pPicBox.Parent.ClientSize.Width - 18
Dim ScaleAmount As Double = (pPicBox.Width / pPicBox.Image.Width)
pPicBox.Height = CInt(pPicBox.Image.Height * ScaleAmount)
End If
End Sub
Public Shared Sub PictureBoxZoomFit(ByRef pPicBox As PictureBox)
If Not Nothing Is pPicBox And Not Nothing Is pPicBox.Parent Then
PictureBoxCenter(pPicBox, (pPicBox.Parent.ClientSize.Width - 7), (pPicBox.Parent.ClientSize.Height - 7))
pPicBox.Location = New Point(0, 0)
End If
End Sub
Public Shared Sub PictureBoxZoomIn(ByRef pPicBox As PictureBox)
If Not Nothing Is pPicBox And Not Nothing Is pPicBox.Parent Then
PictureBoxCenter(pPicBox, (pPicBox.Width * 1.25), (pPicBox.Height * 1.25))
End If
End Sub
Public Shared Sub PictureBoxZoomOut(ByRef pPicBox As PictureBox)
If Not Nothing Is pPicBox Then
PictureBoxCenter(pPicBox, (pPicBox.Width / 1.25), (pPicBox.Height / 1.25))
End If
End Sub
Public Shared Sub PictureBoxCenter(ByRef oPictureBox As PictureBox, ByVal psWidth As Integer, ByVal psHeight As Integer)
oPictureBox.Width = psWidth
oPictureBox.Height = psHeight
RecalcPageLocation(oPictureBox)
End Sub
Public Shared Sub RecalcPageLocation(ByRef oPictureBox As PictureBox)
Dim PageSize As New Size(oPictureBox.Size)
Dim ClientBounds As New Size(oPictureBox.Parent.ClientSize)
Dim PageLocation As New Point(oPictureBox.Location)
Dim HorizontalScrollPosition As Integer = CType(oPictureBox.Parent, Panel).HorizontalScroll.Value
Dim VerticalScrollPosition As Integer = CType(oPictureBox.Parent, Panel).VerticalScroll.Value
Dim LeftMargin As Integer = oPictureBox.Parent.Margin.Left
Dim TopMargin As Integer = oPictureBox.Parent.Margin.Top
If PageSize.Width < ClientBounds.Width AndAlso PageSize.Height > ClientBounds.Height Then
'Center vertically
PageLocation = New Point((ClientBounds.Width - PageSize.Width) / 2 + LeftMargin, TopMargin - VerticalScrollPosition)
ElseIf PageSize.Width > ClientBounds.Width AndAlso PageSize.Height < ClientBounds.Height Then
'Center horizontally
PageLocation = New Point(LeftMargin - HorizontalScrollPosition, (ClientBounds.Height - PageSize.Height) / 2 + TopMargin)
ElseIf PageSize.Width < ClientBounds.Width AndAlso PageSize.Height < ClientBounds.Height Then
'center both
PageLocation = New Point((ClientBounds.Width - PageSize.Width) / 2 + LeftMargin, (ClientBounds.Height - PageSize.Height) / 2 + TopMargin)
Else
PageLocation = New Point(LeftMargin - HorizontalScrollPosition, TopMargin - VerticalScrollPosition)
End If
oPictureBox.Location = PageLocation
oPictureBox.Bounds = New Rectangle(PageLocation, PageSize)
End Sub
Public Shared Sub PictureBoxZoomFitMany(ByRef pPicBox As PictureBox)
If Not Nothing Is pPicBox.Parent Then
Dim Height As Integer = pPicBox.Parent.ClientSize.Height - 14
Dim Width As Integer = pPicBox.Parent.ClientSize.Width - 14
Dim Location As New Point(0, 0)
For Each itemControl As Control In pPicBox.Parent.Controls
If TypeOf itemControl Is PictureBox Then
itemControl.Height = Height
itemControl.Width = Width
itemControl.Location = Location
End If
Next
End If
End Sub
Public Shared Function GenerateThumbnail(ByVal original As System.Drawing.Image, ByVal percentage As Integer) As System.Drawing.Image
If percentage < 1 Then
Throw New Exception("Thumbnail size must be aat least 1% of the original size")
End If
Dim tn As New System.Drawing.Bitmap(CInt(original.Width * 0.01F * percentage), CInt(original.Height * 0.01F * percentage))
Dim g As Graphics = Graphics.FromImage(tn)
g.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBilinear
g.DrawImage(original, New Rectangle(0, 0, tn.Width, tn.Height), 0, 0, original.Width, original.Height, GraphicsUnit.Pixel)
g.Dispose()
Return CType(tn, System.Drawing.Image)
End Function
Public Shared Function SaveImageToTiff(ByVal img As System.Drawing.Image) As String
Dim sTemp As String = My.Computer.FileSystem.SpecialDirectories.Temp & "\DDI_"
Dim sTStamp As String = Format(Now, "yyyyMMddhhmmssfff")
Dim FileName As String = sTemp & sTStamp & ".tif"
img.Save(FileName, ImageFormat.Tiff)
Return FileName
End Function
Public Shared Function GetFrameFromTiff(ByVal Filename As String, ByVal FrameNumber As Integer) As System.Drawing.Image
Dim fs As FileStream = File.Open(Filename, FileMode.Open, FileAccess.Read)
Dim bm As System.Drawing.Bitmap = CType(System.Drawing.Bitmap.FromStream(fs), System.Drawing.Bitmap)
bm.SelectActiveFrame(FrameDimension.Page, FrameNumber)
Dim temp As New System.Drawing.Bitmap(bm.Width, bm.Height)
Dim g As Graphics = Graphics.FromImage(temp)
g.InterpolationMode = InterpolationMode.NearestNeighbor
g.DrawImage(bm, 0, 0, bm.Width, bm.Height)
g.Dispose()
GetFrameFromTiff = temp
fs.Close()
End Function
Public Shared Function GetImagePageFromFileForPrint(ByVal sFileName As String, ByVal iPageNumber As Integer, Optional ByVal DPI As Integer = 300, Optional ByVal password As String = "") As System.Drawing.Image
GetImagePageFromFileForPrint = Nothing
If ImageUtil.IsPDF(sFileName) Then 'get image of page from file for printing
GetImagePageFromFileForPrint = ConvertPDF.PDFConvert.GetPageFromPDF(sFileName, iPageNumber, DPI, password, True)
ElseIf ImageUtil.IsTiff(sFileName) Then
GetImagePageFromFileForPrint = ImageUtil.GetFrameFromTiff(sFileName, iPageNumber - 1)
End If
End Function
Public Shared Function GetImageFrameCount(ByVal sFileName As String, Optional ByVal userPassword As String = "") As Integer
If ImageUtil.IsPDF(sFileName) Then
GetImageFrameCount = iTextSharpUtil.GetPDFPageCount(sFileName, userPassword)
ElseIf ImageUtil.IsTiff(sFileName) Then
GetImageFrameCount = GetTiffFrameCount(sFileName)
End If
End Function
Public Shared Function GetTiffFrameCount(ByVal FileName As String) As Integer
Dim bm As New System.Drawing.Bitmap(FileName)
GetTiffFrameCount = bm.GetFrameCount(FrameDimension.Page)
bm.Dispose()
End Function
Public Shared Sub DeleteFile(ByVal filename As String)
Try
System.IO.File.Delete(filename)
Catch ex As Exception
End Try
End Sub
Public Shared Function IsTiff(ByVal filename As String) As Boolean
If Nothing Is filename Then Return False
Return Regex.IsMatch(filename, "\.tiff*$", RegexOptions.IgnoreCase)
End Function
Public Shared Function IsPDF(ByVal filename As String) As Boolean
If Nothing Is filename Then Return False
Return Regex.IsMatch(filename, "\.pdf$", RegexOptions.IgnoreCase)
End Function
Public Shared Function CropBitmap(ByRef bmp As System.Drawing.Bitmap, ByVal cropX As Integer, ByVal cropY As Integer, ByVal cropWidth As Integer, ByVal cropHeight As Integer) As System.Drawing.Bitmap
Dim rect As New Rectangle(cropX, cropY, cropWidth, cropHeight)
Dim cropped As System.Drawing.Bitmap = bmp.Clone(rect, bmp.PixelFormat)
Return cropped
End Function
Public Shared Sub CompressTiff(ByVal Filename As String)
Dim myBitmap As System.Drawing.Bitmap
Dim myImageCodecInfo As ImageCodecInfo
Dim myEncoder As Encoder
Dim myEncoderParameter1 As EncoderParameter
Dim myEncoderParameter2 As EncoderParameter
Dim myEncoderParameters As EncoderParameters
' Create a Bitmap object based on a BMP file.
myBitmap = New System.Drawing.Bitmap(Filename)
' Get an ImageCodecInfo object that represents the TIFF codec.
myImageCodecInfo = GetEncoderInfo("image/tiff")
' Create an Encoder object based on the GUID
' for the Compression parameter category.
myEncoder = Encoder.Compression
' Create an EncoderParameters object.
' An EncoderParameters object has an array of EncoderParameter
' objects. In this case, there is only one
' EncoderParameter object in the array.
myEncoderParameters = New EncoderParameters(2)
' Save the bitmap as a TIFF file with LZW compression.
myEncoderParameter1 = New EncoderParameter(myEncoder, Fix(EncoderValue.CompressionLZW))
myEncoderParameter2 = New EncoderParameter(Encoder.SaveFlag, CLng(EncoderValue.MultiFrame))
myEncoderParameters.Param(0) = myEncoderParameter1
myEncoderParameters.Param(1) = myEncoderParameter2
Dim outputfilename As String = Filename.Replace(".tif", Now.Ticks & ".tif")
myBitmap.Save(outputfilename, myImageCodecInfo, myEncoderParameters)
Dim FrameCount As Integer = myBitmap.GetFrameCount(FrameDimension.Page)
If FrameCount > 1 Then
For iFrame As Integer = 1 To FrameCount - 1
myBitmap.SelectActiveFrame(FrameDimension.Page, iFrame)
myEncoderParameters.Param(0) = New EncoderParameter(Encoder.SaveFlag, CLng(EncoderValue.FrameDimensionPage))
myBitmap.SaveAdd(myBitmap, myEncoderParameters)
Next
End If
myEncoderParameters.Param(0) = New EncoderParameter(Encoder.SaveFlag, CLng(EncoderValue.Flush))
myBitmap.SaveAdd(myEncoderParameters)
myBitmap.Dispose()
While File.Exists(Filename)
Try
File.Delete(Filename)
Catch
End Try
End While
File.Move(outputfilename, Filename)
End Sub
'Needed subroutine for 1bit conversion
Protected Sub SetIndexedPixel(ByVal x As Integer, ByVal y As Integer, ByVal bmd As BitmapData, ByVal pixel As Boolean)
Dim index As Integer = y * bmd.Stride + (x >> 3)
Dim p As Byte = Marshal.ReadByte(bmd.Scan0, index)
Dim mask As Byte = &H80 >> (x And &H7)
If pixel Then
p = p Or mask
Else
p = p And CByte(mask ^ &HFF)
End If
Marshal.WriteByte(bmd.Scan0, index, p)
End Sub
Private Shared Function GetEncoderInfo(ByVal mimeType As String) As ImageCodecInfo
Dim j As Integer
Dim encoders() As ImageCodecInfo
encoders = ImageCodecInfo.GetImageEncoders()
j = 0
While j < encoders.Length
If encoders(j).MimeType = mimeType Then
Return encoders(j)
End If
j += 1
End While
Return Nothing
End Function
End Class

View File

@@ -0,0 +1,69 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class ImportProgress
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.ProgressBar1 = New System.Windows.Forms.ProgressBar
Me.Label1 = New System.Windows.Forms.Label
Me.SuspendLayout()
'
'ProgressBar1
'
Me.ProgressBar1.Location = New System.Drawing.Point(12, 48)
Me.ProgressBar1.Name = "ProgressBar1"
Me.ProgressBar1.Size = New System.Drawing.Size(288, 23)
Me.ProgressBar1.TabIndex = 0
'
'Label1
'
Me.Label1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Label1.Location = New System.Drawing.Point(12, 18)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(288, 18)
Me.Label1.TabIndex = 1
Me.Label1.Text = "Processing Image Files"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'ImportProgress
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(312, 83)
Me.ControlBox = False
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.ProgressBar1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "ImportProgress"
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "Import Progress"
Me.ResumeLayout(False)
End Sub
Friend WithEvents ProgressBar1 As System.Windows.Forms.ProgressBar
Friend WithEvents Label1 As System.Windows.Forms.Label
End Class

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,15 @@
Imports System.Windows.Forms
Public Class ImportProgress
Private Sub ImportProgress_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Public Sub UpdateProgress(ByVal message As String, ByVal progress As Integer)
Label1.Text = message
ProgressBar1.Increment(progress)
Label1.Update()
End Sub
End Class

View File

@@ -0,0 +1,47 @@
K 25
svn:wc:ra_dav:version-url
V 50
/svn/!svn/ver/2/trunk/PDFView/PDFView/My%20Project
END
Resources.Designer.vb
K 25
svn:wc:ra_dav:version-url
V 73
/svn/!svn/ver/50/trunk/PDFView/PDFView/My%20Project/Resources.Designer.vb
END
Settings.settings
K 25
svn:wc:ra_dav:version-url
V 68
/svn/!svn/ver/2/trunk/PDFView/PDFView/My%20Project/Settings.settings
END
AssemblyInfo.vb
K 25
svn:wc:ra_dav:version-url
V 66
/svn/!svn/ver/2/trunk/PDFView/PDFView/My%20Project/AssemblyInfo.vb
END
Settings.Designer.vb
K 25
svn:wc:ra_dav:version-url
V 71
/svn/!svn/ver/2/trunk/PDFView/PDFView/My%20Project/Settings.Designer.vb
END
Application.Designer.vb
K 25
svn:wc:ra_dav:version-url
V 74
/svn/!svn/ver/2/trunk/PDFView/PDFView/My%20Project/Application.Designer.vb
END
Application.myapp
K 25
svn:wc:ra_dav:version-url
V 68
/svn/!svn/ver/2/trunk/PDFView/PDFView/My%20Project/Application.myapp
END
Resources.resx
K 25
svn:wc:ra_dav:version-url
V 66
/svn/!svn/ver/50/trunk/PDFView/PDFView/My%20Project/Resources.resx
END

View File

@@ -0,0 +1,266 @@
10
dir
43
https://pdfviewernet.googlecode.com/svn/trunk/PDFView/PDFView/My%20Project
https://pdfviewernet.googlecode.com/svn
2009-06-18T12:55:19.630441Z
2
snakebyteme2
3774bada-5c05-11de-8888-c79ed7c8b0c3
Resources.Designer.vb
file
50
2009-08-15T21:06:19.869287Z
c4f7e9ec95ad023cf86f2349544f263d
2009-08-15T21:11:39.159177Z
50
snakebyteme2
6977
Settings.settings
file
2009-06-27T13:39:42.404000Z
4a12ce12282d0ee237b12e7513037c50
2009-06-18T12:55:19.630441Z
2
snakebyteme2
279
AssemblyInfo.vb
file
2009-06-27T13:39:41.205000Z
f4198dcca55008c9dce326392cb294f4
2009-06-18T12:55:19.630441Z
2
snakebyteme2
1171
Settings.Designer.vb
file
2009-06-27T13:39:42.177000Z
a4d7a71dee947cc4e2d161336d46e85b
2009-06-18T12:55:19.630441Z
2
snakebyteme2
2973
Application.Designer.vb
file
2009-06-27T13:39:40.598000Z
3f9fff7947fbcb3bb298a181ac41a998
2009-06-18T12:55:19.630441Z
2
snakebyteme2
440
Application.myapp
file
2009-06-27T13:39:40.882000Z
9a61ce94d05f84833fa4cff2de9a56b2
2009-06-18T12:55:19.630441Z
2
snakebyteme2
481
Resources.resx
file
50
2009-08-15T21:06:19.834287Z
1c500d4be5e429b8dcfc373a6750d86e
2009-08-15T21:11:39.159177Z
50
snakebyteme2
8723

View File

@@ -0,0 +1,13 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:2.0.50727.3074
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>false</MySubMain>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<ApplicationType>1</ApplicationType>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>

View File

@@ -0,0 +1,35 @@
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("PDFViewer")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("PDFViewer")>
<Assembly: AssemblyCopyright("Copyright © 2009")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("2c94eaa7-7e88-40ea-bab7-e10979b1845f")>
' Version information for an assembly consists of the following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@@ -0,0 +1,155 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:2.0.50727.3074
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Imports System
Namespace My.Resources
'This class was auto-generated by the StronglyTypedResourceBuilder
'class via a tool like ResGen or Visual Studio.
'To add or remove a member, edit your .ResX file then rerun ResGen
'with the /str option, or rebuild your VS project.
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("PDFView.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Overrides the current thread's CurrentUICulture property for all
''' resource lookups using this strongly typed resource class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set
resourceCulture = value
End Set
End Property
'''<summary>
''' Looks up a localized string similar to &lt;HTML&gt;
'''&lt;HEAD&gt;
'''&lt;TITLE&gt;PageIndex&lt;/TITLE&gt;
'''&lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&gt;
'''function changeImage(filename)
'''{
''' parent.pageviewer.document.images[&apos;mainimage&apos;].src = filename;
'''}
'''&lt;/script&gt;
'''&lt;/HEAD&gt;
'''&lt;BODY bgcolor=&quot;#DDDDDD&quot;&gt;{Body}&lt;/BODY&gt;
'''&lt;/HTML&gt;.
'''</summary>
Friend ReadOnly Property BookmarkHtml() As String
Get
Return ResourceManager.GetString("BookmarkHtml", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to &lt;HTML&gt;
'''&lt;HEAD&gt;
'''&lt;TITLE&gt;PDF to Image Html&lt;/TITLE&gt;
'''&lt;/HEAD&gt;
'''&lt;FRAMESET ROWS=&quot;50,*&quot; FRAMEBORDER=0 BORDER=0 &gt;
''' &lt;FRAME NAME=&quot;top&quot; SRC=&quot;content/top.html&quot; MARGINHEIGHT=0 MARGINWIDTH=0 NORESIZE&gt;
''' &lt;FRAMESET COLS=&quot;20%,80%&quot; FRAMEBORDER=0 BORDER=0&gt;
''' &lt;FRAME NAME=&quot;left&quot; SRC=&quot;content/bookmark.html&quot; MARGINHEIGHT=0 MARGINWIDTH=0 SCROLLING=AUTO NORESIZE&gt;
''' &lt;FRAMESET ROWS=&quot;*,25&quot; FRAMEBORDER=0 BORDER=0 &gt;
''' &lt;FRAME NAME=&quot;pa [rest of string was truncated]&quot;;.
'''</summary>
Friend ReadOnly Property FrameHtml() As String
Get
Return ResourceManager.GetString("FrameHtml", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to &lt;HTML&gt;
'''&lt;HEAD&gt;
'''&lt;TITLE&gt;PageViewer&lt;/TITLE&gt;
'''&lt;/HEAD&gt;
'''&lt;BODY bgcolor=&quot;#999999&quot;&gt;&lt;center&gt;&lt;img id=&quot;mainimage&quot; src=&quot;images/page1.png&quot; width=&quot;100%&quot;&gt;&lt;/center&gt;&lt;/BODY&gt;
'''&lt;/HTML&gt;.
'''</summary>
Friend ReadOnly Property PageHtml() As String
Get
Return ResourceManager.GetString("PageHtml", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to &lt;HTML&gt;
'''&lt;HEAD&gt;
'''&lt;TITLE&gt;PageSize&lt;/TITLE&gt;
'''&lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&gt;
'''function fitScreen()
'''{
'''parent.pageviewer.document.images[&apos;mainimage&apos;].style.height = &apos;100%&apos;;
'''parent.pageviewer.document.images[&apos;mainimage&apos;].style.width = &apos;auto&apos;;
'''}
'''function fitWidth()
'''{
'''parent.pageviewer.document.images[&apos;mainimage&apos;].style.height = &apos;auto&apos;;
'''parent.pageviewer.document.images[&apos;mainimage&apos;].style.width = &apos;100%&apos;;
'''}
'''function fitActual()
'''{
'''parent.pageviewer.document.images[&apos;mainimage&apos;].style.height = &apos;auto&apos;;
'''parent [rest of string was truncated]&quot;;.
'''</summary>
Friend ReadOnly Property PagesizeHtml() As String
Get
Return ResourceManager.GetString("PagesizeHtml", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to &lt;HTML&gt;
'''&lt;HEAD&gt;
'''&lt;TITLE&gt;DocumentName&lt;/TITLE&gt;
'''&lt;/HEAD&gt;
'''&lt;BODY bgcolor=&quot;#BBBBBB&quot;&gt;{DocumentName}&lt;/BODY&gt;
'''&lt;/HTML&gt;.
'''</summary>
Friend ReadOnly Property TopHtml() As String
Get
Return ResourceManager.GetString("TopHtml", resourceCulture)
End Get
End Property
End Module
End Namespace

View File

@@ -0,0 +1,196 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="BookmarkHtml" xml:space="preserve">
<value>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;PageIndex&lt;/TITLE&gt;
&lt;SCRIPT LANGUAGE="JavaScript"&gt;
function changeImage(filename)
{
parent.pageviewer.document.images['mainimage'].src = filename;
}
&lt;/script&gt;
&lt;/HEAD&gt;
&lt;BODY bgcolor="#DDDDDD"&gt;{Body}&lt;/BODY&gt;
&lt;/HTML&gt;</value>
</data>
<data name="FrameHtml" xml:space="preserve">
<value>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;PDF to Image Html&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;FRAMESET ROWS="50,*" FRAMEBORDER=0 BORDER=0 &gt;
&lt;FRAME NAME="top" SRC="content/top.html" MARGINHEIGHT=0 MARGINWIDTH=0 NORESIZE&gt;
&lt;FRAMESET COLS="20%,80%" FRAMEBORDER=0 BORDER=0&gt;
&lt;FRAME NAME="left" SRC="content/bookmark.html" MARGINHEIGHT=0 MARGINWIDTH=0 SCROLLING=AUTO NORESIZE&gt;
&lt;FRAMESET ROWS="*,25" FRAMEBORDER=0 BORDER=0 &gt;
&lt;FRAME NAME="pageviewer" SRC="content/page.html" MARGINHEIGHT=0 MARGINWIDTH=0 SCROLLING=AUTO NORESIZE&gt;
&lt;FRAME NAME="pagesize" SRC="content/pagesize.html" MARGINHEIGHT=0 MARGINWIDTH=0 NORESIZE&gt;
&lt;/FRAMESET&gt;
&lt;/FRAMESET&gt;
&lt;/HTML&gt;</value>
</data>
<data name="PageHtml" xml:space="preserve">
<value>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;PageViewer&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;BODY bgcolor="#999999"&gt;&lt;center&gt;&lt;img id="mainimage" src="images/page1.png" width="100%"&gt;&lt;/center&gt;&lt;/BODY&gt;
&lt;/HTML&gt;</value>
</data>
<data name="PagesizeHtml" xml:space="preserve">
<value>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;PageSize&lt;/TITLE&gt;
&lt;SCRIPT LANGUAGE="JavaScript"&gt;
function fitScreen()
{
parent.pageviewer.document.images['mainimage'].style.height = '100%';
parent.pageviewer.document.images['mainimage'].style.width = 'auto';
}
function fitWidth()
{
parent.pageviewer.document.images['mainimage'].style.height = 'auto';
parent.pageviewer.document.images['mainimage'].style.width = '100%';
}
function fitActual()
{
parent.pageviewer.document.images['mainimage'].style.height = 'auto';
parent.pageviewer.document.images['mainimage'].style.width = 'auto';
}
&lt;/script&gt;
&lt;/HEAD&gt;
&lt;BODY bgcolor="#BBBBBB"&gt;
&lt;center&gt;
&lt;a href="javascript:fitScreen()"&gt;Fit To Screen&lt;/a&gt;&amp;nbsp;&amp;nbsp;
&lt;a href="javascript:fitWidth()"&gt;Fit To Width&lt;/a&gt;&amp;nbsp;&amp;nbsp;
&lt;a href="javascript:fitActual()"&gt;Actual Size&lt;/a&gt;
&lt;/center&gt;&lt;/BODY&gt;
&lt;/HTML&gt;</value>
</data>
<data name="TopHtml" xml:space="preserve">
<value>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;DocumentName&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;BODY bgcolor="#BBBBBB"&gt;{DocumentName}&lt;/BODY&gt;
&lt;/HTML&gt;</value>
</data>
</root>

View File

@@ -0,0 +1,73 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:2.0.50727.3074
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings),MySettings)
#Region "My.Settings Auto-Save Functionality"
#If _MyType = "WindowsForms" Then
Private Shared addedHandler As Boolean
Private Shared addedHandlerLockObject As New Object
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then
My.Settings.Save()
End If
End Sub
#End If
#End Region
Public Shared ReadOnly Property [Default]() As MySettings
Get
#If _MyType = "WindowsForms" Then
If Not addedHandler Then
SyncLock addedHandlerLockObject
If Not addedHandler Then
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
addedHandler = True
End If
End SyncLock
End If
#End If
Return defaultInstance
End Get
End Property
End Class
End Namespace
Namespace My
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.PDFView.My.MySettings
Get
Return Global.PDFView.My.MySettings.Default
End Get
End Property
End Module
End Namespace

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@@ -0,0 +1,13 @@
'------------------------------------------------------------------------------
' <auto-generated>
' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:4.0.30319.42000
'
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>false</MySubMain>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<ApplicationType>1</ApplicationType>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>

View File

@@ -0,0 +1,35 @@
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("PDFViewer")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("PDFViewer")>
<Assembly: AssemblyCopyright("Copyright © 2009")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("2c94eaa7-7e88-40ea-bab7-e10979b1845f")>
' Version information for an assembly consists of the following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@@ -0,0 +1,155 @@
'------------------------------------------------------------------------------
' <auto-generated>
' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:4.0.30319.42000
'
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Imports System
Namespace My.Resources
'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
'-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
'''<summary>
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("PDFView.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set
resourceCulture = value
End Set
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &lt;HTML&gt;
'''&lt;HEAD&gt;
'''&lt;TITLE&gt;PageIndex&lt;/TITLE&gt;
'''&lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&gt;
'''function changeImage(filename)
'''{
''' parent.pageviewer.document.images[&apos;mainimage&apos;].src = filename;
'''}
'''&lt;/script&gt;
'''&lt;/HEAD&gt;
'''&lt;BODY bgcolor=&quot;#DDDDDD&quot;&gt;{Body}&lt;/BODY&gt;
'''&lt;/HTML&gt; ähnelt.
'''</summary>
Friend ReadOnly Property BookmarkHtml() As String
Get
Return ResourceManager.GetString("BookmarkHtml", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &lt;HTML&gt;
'''&lt;HEAD&gt;
'''&lt;TITLE&gt;PDF to Image Html&lt;/TITLE&gt;
'''&lt;/HEAD&gt;
'''&lt;FRAMESET ROWS=&quot;50,*&quot; FRAMEBORDER=0 BORDER=0 &gt;
''' &lt;FRAME NAME=&quot;top&quot; SRC=&quot;content/top.html&quot; MARGINHEIGHT=0 MARGINWIDTH=0 NORESIZE&gt;
''' &lt;FRAMESET COLS=&quot;20%,80%&quot; FRAMEBORDER=0 BORDER=0&gt;
''' &lt;FRAME NAME=&quot;left&quot; SRC=&quot;content/bookmark.html&quot; MARGINHEIGHT=0 MARGINWIDTH=0 SCROLLING=AUTO NORESIZE&gt;
''' &lt;FRAMESET ROWS=&quot;*,25&quot; FRAMEBORDER=0 BORDER=0 &gt;
''' &lt;FRAME NAME=&quot;pa [Rest der Zeichenfolge wurde abgeschnitten]&quot;; ähnelt.
'''</summary>
Friend ReadOnly Property FrameHtml() As String
Get
Return ResourceManager.GetString("FrameHtml", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &lt;HTML&gt;
'''&lt;HEAD&gt;
'''&lt;TITLE&gt;PageViewer&lt;/TITLE&gt;
'''&lt;/HEAD&gt;
'''&lt;BODY bgcolor=&quot;#999999&quot;&gt;&lt;center&gt;&lt;img id=&quot;mainimage&quot; src=&quot;images/page1.png&quot; width=&quot;100%&quot;&gt;&lt;/center&gt;&lt;/BODY&gt;
'''&lt;/HTML&gt; ähnelt.
'''</summary>
Friend ReadOnly Property PageHtml() As String
Get
Return ResourceManager.GetString("PageHtml", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &lt;HTML&gt;
'''&lt;HEAD&gt;
'''&lt;TITLE&gt;PageSize&lt;/TITLE&gt;
'''&lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&gt;
'''function fitScreen()
'''{
'''parent.pageviewer.document.images[&apos;mainimage&apos;].style.height = &apos;100%&apos;;
'''parent.pageviewer.document.images[&apos;mainimage&apos;].style.width = &apos;auto&apos;;
'''}
'''function fitWidth()
'''{
'''parent.pageviewer.document.images[&apos;mainimage&apos;].style.height = &apos;auto&apos;;
'''parent.pageviewer.document.images[&apos;mainimage&apos;].style.width = &apos;100%&apos;;
'''}
'''function fitActual()
'''{
'''parent.pageviewer.document.images[&apos;mainimage&apos;].style.height = &apos;auto&apos;;
'''parent [Rest der Zeichenfolge wurde abgeschnitten]&quot;; ähnelt.
'''</summary>
Friend ReadOnly Property PagesizeHtml() As String
Get
Return ResourceManager.GetString("PagesizeHtml", resourceCulture)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Zeichenfolge, die &lt;HTML&gt;
'''&lt;HEAD&gt;
'''&lt;TITLE&gt;DocumentName&lt;/TITLE&gt;
'''&lt;/HEAD&gt;
'''&lt;BODY bgcolor=&quot;#BBBBBB&quot;&gt;{DocumentName}&lt;/BODY&gt;
'''&lt;/HTML&gt; ähnelt.
'''</summary>
Friend ReadOnly Property TopHtml() As String
Get
Return ResourceManager.GetString("TopHtml", resourceCulture)
End Get
End Property
End Module
End Namespace

View File

@@ -0,0 +1,196 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="BookmarkHtml" xml:space="preserve">
<value>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;PageIndex&lt;/TITLE&gt;
&lt;SCRIPT LANGUAGE="JavaScript"&gt;
function changeImage(filename)
{
parent.pageviewer.document.images['mainimage'].src = filename;
}
&lt;/script&gt;
&lt;/HEAD&gt;
&lt;BODY bgcolor="#DDDDDD"&gt;{Body}&lt;/BODY&gt;
&lt;/HTML&gt;</value>
</data>
<data name="FrameHtml" xml:space="preserve">
<value>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;PDF to Image Html&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;FRAMESET ROWS="50,*" FRAMEBORDER=0 BORDER=0 &gt;
&lt;FRAME NAME="top" SRC="content/top.html" MARGINHEIGHT=0 MARGINWIDTH=0 NORESIZE&gt;
&lt;FRAMESET COLS="20%,80%" FRAMEBORDER=0 BORDER=0&gt;
&lt;FRAME NAME="left" SRC="content/bookmark.html" MARGINHEIGHT=0 MARGINWIDTH=0 SCROLLING=AUTO NORESIZE&gt;
&lt;FRAMESET ROWS="*,25" FRAMEBORDER=0 BORDER=0 &gt;
&lt;FRAME NAME="pageviewer" SRC="content/page.html" MARGINHEIGHT=0 MARGINWIDTH=0 SCROLLING=AUTO NORESIZE&gt;
&lt;FRAME NAME="pagesize" SRC="content/pagesize.html" MARGINHEIGHT=0 MARGINWIDTH=0 NORESIZE&gt;
&lt;/FRAMESET&gt;
&lt;/FRAMESET&gt;
&lt;/HTML&gt;</value>
</data>
<data name="PageHtml" xml:space="preserve">
<value>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;PageViewer&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;BODY bgcolor="#999999"&gt;&lt;center&gt;&lt;img id="mainimage" src="images/page1.png" width="100%"&gt;&lt;/center&gt;&lt;/BODY&gt;
&lt;/HTML&gt;</value>
</data>
<data name="PagesizeHtml" xml:space="preserve">
<value>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;PageSize&lt;/TITLE&gt;
&lt;SCRIPT LANGUAGE="JavaScript"&gt;
function fitScreen()
{
parent.pageviewer.document.images['mainimage'].style.height = '100%';
parent.pageviewer.document.images['mainimage'].style.width = 'auto';
}
function fitWidth()
{
parent.pageviewer.document.images['mainimage'].style.height = 'auto';
parent.pageviewer.document.images['mainimage'].style.width = '100%';
}
function fitActual()
{
parent.pageviewer.document.images['mainimage'].style.height = 'auto';
parent.pageviewer.document.images['mainimage'].style.width = 'auto';
}
&lt;/script&gt;
&lt;/HEAD&gt;
&lt;BODY bgcolor="#BBBBBB"&gt;
&lt;center&gt;
&lt;a href="javascript:fitScreen()"&gt;Fit To Screen&lt;/a&gt;&amp;nbsp;&amp;nbsp;
&lt;a href="javascript:fitWidth()"&gt;Fit To Width&lt;/a&gt;&amp;nbsp;&amp;nbsp;
&lt;a href="javascript:fitActual()"&gt;Actual Size&lt;/a&gt;
&lt;/center&gt;&lt;/BODY&gt;
&lt;/HTML&gt;</value>
</data>
<data name="TopHtml" xml:space="preserve">
<value>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;DocumentName&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;BODY bgcolor="#BBBBBB"&gt;{DocumentName}&lt;/BODY&gt;
&lt;/HTML&gt;</value>
</data>
</root>

View File

@@ -0,0 +1,73 @@
'------------------------------------------------------------------------------
' <auto-generated>
' Dieser Code wurde von einem Tool generiert.
' Laufzeitversion:4.0.30319.42000
'
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
' der Code erneut generiert wird.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
#Region "Funktion zum automatischen Speichern von My.Settings"
#If _MyType = "WindowsForms" Then
Private Shared addedHandler As Boolean
Private Shared addedHandlerLockObject As New Object
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then
My.Settings.Save()
End If
End Sub
#End If
#End Region
Public Shared ReadOnly Property [Default]() As MySettings
Get
#If _MyType = "WindowsForms" Then
If Not addedHandler Then
SyncLock addedHandlerLockObject
If Not addedHandler Then
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
addedHandler = True
End If
End SyncLock
End If
#End If
Return defaultInstance
End Get
End Property
End Class
End Namespace
Namespace My
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.PDFView.My.MySettings
Get
Return Global.PDFView.My.MySettings.Default
End Get
End Property
End Module
End Namespace

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@@ -0,0 +1,205 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{170D7D1B-61B9-4E8B-9CD3-88350725379F}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>PDFView</RootNamespace>
<AssemblyName>PDFView</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<OptionExplicit>On</OptionExplicit>
<OptionCompare>Binary</OptionCompare>
<OptionStrict>Off</OptionStrict>
<OptionInfer>On</OptionInfer>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>PDFView.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355</NoWarn>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>PDFView.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355</NoWarn>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="itextsharp, Version=4.1.2.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca">
<SpecificVersion>False</SpecificVersion>
<HintPath>lib\itextsharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="PDFLibNet, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>lib\PDFLibNet.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.XML" />
<Reference Include="tessnet2_32, Version=2.0.4.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>lib\tessnet2_32.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Diagnostics" />
</ItemGroup>
<ItemGroup>
<Compile Include="AFPDFLibUtil.vb" />
<Compile Include="ExportImageOptions.Designer.vb">
<DependentUpon>ExportImageOptions.vb</DependentUpon>
</Compile>
<Compile Include="ExportImageOptions.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="ExportOptions.Designer.vb">
<DependentUpon>ExportOptions.vb</DependentUpon>
</Compile>
<Compile Include="ExportOptions.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="GhostScriptLib.vb" />
<Compile Include="ImageUtil.vb" />
<Compile Include="ImportProgress.Designer.vb">
<DependentUpon>ImportProgress.vb</DependentUpon>
</Compile>
<Compile Include="ImportProgress.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="iTextSharpUtil.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="Password.Designer.vb">
<DependentUpon>Password.vb</DependentUpon>
</Compile>
<Compile Include="Password.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="PDFViewer.Designer.vb">
<DependentUpon>PDFViewer.vb</DependentUpon>
</Compile>
<Compile Include="PDFViewer.vb">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="PrinterUtil.vb" />
<Compile Include="TesseractOCR.vb" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ExportImageOptions.resx">
<DependentUpon>ExportImageOptions.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="ExportOptions.resx">
<DependentUpon>ExportOptions.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="ImportProgress.resx">
<DependentUpon>ImportProgress.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Password.resx">
<DependentUpon>Password.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="PDFViewer.resx">
<DependentUpon>PDFViewer.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>copy "$(ProjectDir)lib\gsdll32.dll" "$(TargetDir)"
copy "$(ProjectDir)lib\itextsharp.dll" "$(TargetDir)"
copy "$(ProjectDir)lib\PDFLibNET.dll" "$(TargetDir)"
copy "$(ProjectDir)lib\tessnet2_32.dll" "$(TargetDir)"
xcopy "$(ProjectDir)lib\tessdata" "$(TargetDir)tessdata" /s /e /i /h /Y</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
<PropertyGroup>
<PublishUrlHistory />
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>de-DE</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,336 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class PDFViewer
Inherits System.Windows.Forms.UserControl
'UserControl overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(PDFViewer))
Me.ToolStrip1 = New System.Windows.Forms.ToolStrip
Me.tsPrint = New System.Windows.Forms.ToolStripButton
Me.ToolStripSeparator4 = New System.Windows.Forms.ToolStripSeparator
Me.tsPageLabel = New System.Windows.Forms.ToolStripLabel
Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator
Me.tsPrevious = New System.Windows.Forms.ToolStripButton
Me.tsNext = New System.Windows.Forms.ToolStripButton
Me.ToolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator
Me.ToolStripLabel2 = New System.Windows.Forms.ToolStripLabel
Me.tsPageNum = New System.Windows.Forms.ToolStripTextBox
Me.ToolStripSeparator3 = New System.Windows.Forms.ToolStripSeparator
Me.tsZoomOut = New System.Windows.Forms.ToolStripButton
Me.tsZoomIn = New System.Windows.Forms.ToolStripButton
Me.tsRotateCC = New System.Windows.Forms.ToolStripButton
Me.tsRotateC = New System.Windows.Forms.ToolStripButton
Me.ToolStripLabel3 = New System.Windows.Forms.ToolStripLabel
Me.tscbZoom = New System.Windows.Forms.ToolStripComboBox
Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel
Me.tsBottom = New System.Windows.Forms.ToolStrip
Me.tbSearchText = New System.Windows.Forms.ToolStripTextBox
Me.btSearch = New System.Windows.Forms.ToolStripButton
Me.btNext = New System.Windows.Forms.ToolStripButton
Me.ToolStripSeparator5 = New System.Windows.Forms.ToolStripSeparator
Me.tsExport = New System.Windows.Forms.ToolStripButton
Me.tsImport = New System.Windows.Forms.ToolStripButton
Me.TreeView1 = New System.Windows.Forms.TreeView
Me.Panel1 = New System.Windows.Forms.Panel
Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog
Me.SaveFileDialog1 = New System.Windows.Forms.SaveFileDialog
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.ToolStrip1.SuspendLayout()
Me.TableLayoutPanel1.SuspendLayout()
Me.tsBottom.SuspendLayout()
Me.SuspendLayout()
'
'ToolStrip1
'
Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tsPrint, Me.ToolStripSeparator4, Me.tsPageLabel, Me.ToolStripSeparator1, Me.tsPrevious, Me.tsNext, Me.ToolStripSeparator2, Me.ToolStripLabel2, Me.tsPageNum, Me.ToolStripSeparator3, Me.tsZoomOut, Me.tsZoomIn, Me.tsRotateCC, Me.tsRotateC, Me.ToolStripLabel3, Me.tscbZoom})
Me.ToolStrip1.Location = New System.Drawing.Point(0, 0)
Me.ToolStrip1.Name = "ToolStrip1"
Me.ToolStrip1.Size = New System.Drawing.Size(543, 25)
Me.ToolStrip1.TabIndex = 0
Me.ToolStrip1.Text = "ToolStrip1"
'
'tsPrint
'
Me.tsPrint.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.tsPrint.Image = CType(resources.GetObject("tsPrint.Image"), System.Drawing.Image)
Me.tsPrint.ImageTransparentColor = System.Drawing.Color.Black
Me.tsPrint.Name = "tsPrint"
Me.tsPrint.Size = New System.Drawing.Size(23, 22)
Me.tsPrint.Text = "ToolStripButton1"
Me.tsPrint.ToolTipText = "Print"
'
'ToolStripSeparator4
'
Me.ToolStripSeparator4.Name = "ToolStripSeparator4"
Me.ToolStripSeparator4.Size = New System.Drawing.Size(6, 25)
'
'tsPageLabel
'
Me.tsPageLabel.Name = "tsPageLabel"
Me.tsPageLabel.Size = New System.Drawing.Size(112, 22)
Me.tsPageLabel.Text = "Page Number 1 of 1"
'
'ToolStripSeparator1
'
Me.ToolStripSeparator1.Name = "ToolStripSeparator1"
Me.ToolStripSeparator1.Size = New System.Drawing.Size(6, 25)
'
'tsPrevious
'
Me.tsPrevious.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.tsPrevious.Image = CType(resources.GetObject("tsPrevious.Image"), System.Drawing.Image)
Me.tsPrevious.ImageTransparentColor = System.Drawing.Color.Magenta
Me.tsPrevious.Name = "tsPrevious"
Me.tsPrevious.Size = New System.Drawing.Size(23, 22)
Me.tsPrevious.Text = "ToolStripButton1"
Me.tsPrevious.ToolTipText = "Previous Page"
'
'tsNext
'
Me.tsNext.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.tsNext.Image = CType(resources.GetObject("tsNext.Image"), System.Drawing.Image)
Me.tsNext.ImageTransparentColor = System.Drawing.Color.Magenta
Me.tsNext.Name = "tsNext"
Me.tsNext.Size = New System.Drawing.Size(23, 22)
Me.tsNext.Text = "ToolStripButton2"
Me.tsNext.ToolTipText = "Next Page"
'
'ToolStripSeparator2
'
Me.ToolStripSeparator2.Name = "ToolStripSeparator2"
Me.ToolStripSeparator2.Size = New System.Drawing.Size(6, 25)
'
'ToolStripLabel2
'
Me.ToolStripLabel2.Name = "ToolStripLabel2"
Me.ToolStripLabel2.Size = New System.Drawing.Size(65, 22)
Me.ToolStripLabel2.Text = "Go to page"
'
'tsPageNum
'
Me.tsPageNum.Name = "tsPageNum"
Me.tsPageNum.Size = New System.Drawing.Size(40, 25)
'
'ToolStripSeparator3
'
Me.ToolStripSeparator3.Name = "ToolStripSeparator3"
Me.ToolStripSeparator3.Size = New System.Drawing.Size(6, 25)
'
'tsZoomOut
'
Me.tsZoomOut.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.tsZoomOut.Image = CType(resources.GetObject("tsZoomOut.Image"), System.Drawing.Image)
Me.tsZoomOut.ImageTransparentColor = System.Drawing.Color.Magenta
Me.tsZoomOut.Name = "tsZoomOut"
Me.tsZoomOut.Size = New System.Drawing.Size(23, 22)
Me.tsZoomOut.Text = "ToolStripButton3"
Me.tsZoomOut.ToolTipText = "Zoom Out"
'
'tsZoomIn
'
Me.tsZoomIn.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.tsZoomIn.Image = CType(resources.GetObject("tsZoomIn.Image"), System.Drawing.Image)
Me.tsZoomIn.ImageTransparentColor = System.Drawing.Color.Magenta
Me.tsZoomIn.Name = "tsZoomIn"
Me.tsZoomIn.Size = New System.Drawing.Size(23, 22)
Me.tsZoomIn.Text = "ToolStripButton4"
Me.tsZoomIn.ToolTipText = "Zoom In"
'
'tsRotateCC
'
Me.tsRotateCC.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.tsRotateCC.Image = CType(resources.GetObject("tsRotateCC.Image"), System.Drawing.Image)
Me.tsRotateCC.ImageTransparentColor = System.Drawing.Color.Magenta
Me.tsRotateCC.Name = "tsRotateCC"
Me.tsRotateCC.Size = New System.Drawing.Size(23, 22)
Me.tsRotateCC.Text = "Rotate the page counterclockwise"
'
'tsRotateC
'
Me.tsRotateC.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.tsRotateC.Image = CType(resources.GetObject("tsRotateC.Image"), System.Drawing.Image)
Me.tsRotateC.ImageTransparentColor = System.Drawing.Color.Magenta
Me.tsRotateC.Name = "tsRotateC"
Me.tsRotateC.Size = New System.Drawing.Size(23, 22)
Me.tsRotateC.Text = "Rotate the page clockwise"
'
'ToolStripLabel3
'
Me.ToolStripLabel3.Name = "ToolStripLabel3"
Me.ToolStripLabel3.Size = New System.Drawing.Size(10, 22)
Me.ToolStripLabel3.Text = " "
'
'tscbZoom
'
Me.tscbZoom.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.tscbZoom.Name = "tscbZoom"
Me.tscbZoom.Size = New System.Drawing.Size(100, 25)
'
'TableLayoutPanel1
'
Me.TableLayoutPanel1.ColumnCount = 2
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20.0!))
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 80.0!))
Me.TableLayoutPanel1.Controls.Add(Me.tsBottom, 0, 1)
Me.TableLayoutPanel1.Controls.Add(Me.TreeView1, 0, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Panel1, 1, 0)
Me.TableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill
Me.TableLayoutPanel1.Location = New System.Drawing.Point(0, 25)
Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
Me.TableLayoutPanel1.RowCount = 2
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
Me.TableLayoutPanel1.Size = New System.Drawing.Size(543, 401)
Me.TableLayoutPanel1.TabIndex = 2
'
'tsBottom
'
Me.TableLayoutPanel1.SetColumnSpan(Me.tsBottom, 2)
Me.tsBottom.Dock = System.Windows.Forms.DockStyle.Bottom
Me.tsBottom.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tbSearchText, Me.btSearch, Me.btNext, Me.ToolStripSeparator5, Me.tsExport, Me.tsImport})
Me.tsBottom.Location = New System.Drawing.Point(0, 376)
Me.tsBottom.Name = "tsBottom"
Me.tsBottom.Size = New System.Drawing.Size(543, 25)
Me.tsBottom.TabIndex = 7
Me.tsBottom.Text = "Export PDF to another file format"
'
'tbSearchText
'
Me.tbSearchText.Name = "tbSearchText"
Me.tbSearchText.Size = New System.Drawing.Size(100, 25)
'
'btSearch
'
Me.btSearch.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.btSearch.Image = CType(resources.GetObject("btSearch.Image"), System.Drawing.Image)
Me.btSearch.ImageTransparentColor = System.Drawing.Color.Magenta
Me.btSearch.Name = "btSearch"
Me.btSearch.Size = New System.Drawing.Size(23, 22)
Me.btSearch.Text = "Search"
'
'btNext
'
Me.btNext.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.btNext.Image = CType(resources.GetObject("btNext.Image"), System.Drawing.Image)
Me.btNext.ImageTransparentColor = System.Drawing.Color.Magenta
Me.btNext.Name = "btNext"
Me.btNext.Size = New System.Drawing.Size(23, 22)
Me.btNext.Text = "Search for next match"
'
'ToolStripSeparator5
'
Me.ToolStripSeparator5.Name = "ToolStripSeparator5"
Me.ToolStripSeparator5.Size = New System.Drawing.Size(6, 25)
'
'tsExport
'
Me.tsExport.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.tsExport.Image = CType(resources.GetObject("tsExport.Image"), System.Drawing.Image)
Me.tsExport.ImageTransparentColor = System.Drawing.Color.Magenta
Me.tsExport.Name = "tsExport"
Me.tsExport.Size = New System.Drawing.Size(23, 22)
Me.tsExport.Text = "Export PDF to another file format"
'
'tsImport
'
Me.tsImport.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.tsImport.Image = CType(resources.GetObject("tsImport.Image"), System.Drawing.Image)
Me.tsImport.ImageTransparentColor = System.Drawing.Color.Magenta
Me.tsImport.Name = "tsImport"
Me.tsImport.Size = New System.Drawing.Size(23, 22)
Me.tsImport.Text = "Import images to the PDF file format"
'
'TreeView1
'
Me.TreeView1.Dock = System.Windows.Forms.DockStyle.Fill
Me.TreeView1.Location = New System.Drawing.Point(3, 3)
Me.TreeView1.Name = "TreeView1"
Me.TreeView1.Size = New System.Drawing.Size(102, 370)
Me.TreeView1.TabIndex = 2
'
'Panel1
'
Me.Panel1.AutoScroll = True
Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
Me.Panel1.Location = New System.Drawing.Point(111, 3)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(429, 370)
Me.Panel1.TabIndex = 8
'
'OpenFileDialog1
'
Me.OpenFileDialog1.FileName = "OpenFileDialog1"
'
'Timer1
'
Me.Timer1.Interval = 250
'
'PDFViewer
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.Controls.Add(Me.TableLayoutPanel1)
Me.Controls.Add(Me.ToolStrip1)
Me.Name = "PDFViewer"
Me.Size = New System.Drawing.Size(543, 426)
Me.ToolStrip1.ResumeLayout(False)
Me.ToolStrip1.PerformLayout()
Me.TableLayoutPanel1.ResumeLayout(False)
Me.TableLayoutPanel1.PerformLayout()
Me.tsBottom.ResumeLayout(False)
Me.tsBottom.PerformLayout()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip
Friend WithEvents tsPageLabel As System.Windows.Forms.ToolStripLabel
Friend WithEvents ToolStripSeparator1 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents tsPrevious As System.Windows.Forms.ToolStripButton
Friend WithEvents tsNext As System.Windows.Forms.ToolStripButton
Friend WithEvents ToolStripSeparator2 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents ToolStripLabel2 As System.Windows.Forms.ToolStripLabel
Friend WithEvents tsPageNum As System.Windows.Forms.ToolStripTextBox
Friend WithEvents ToolStripSeparator3 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents tsZoomOut As System.Windows.Forms.ToolStripButton
Friend WithEvents tsZoomIn As System.Windows.Forms.ToolStripButton
Friend WithEvents tscbZoom As System.Windows.Forms.ToolStripComboBox
Friend WithEvents ToolStripLabel3 As System.Windows.Forms.ToolStripLabel
Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel
Friend WithEvents TreeView1 As System.Windows.Forms.TreeView
Friend WithEvents tsPrint As System.Windows.Forms.ToolStripButton
Friend WithEvents ToolStripSeparator4 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents tsRotateCC As System.Windows.Forms.ToolStripButton
Friend WithEvents tsRotateC As System.Windows.Forms.ToolStripButton
Friend WithEvents tsBottom As System.Windows.Forms.ToolStrip
Friend WithEvents tbSearchText As System.Windows.Forms.ToolStripTextBox
Friend WithEvents btSearch As System.Windows.Forms.ToolStripButton
Friend WithEvents btNext As System.Windows.Forms.ToolStripButton
Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog
Friend WithEvents SaveFileDialog1 As System.Windows.Forms.SaveFileDialog
Friend WithEvents ToolStripSeparator5 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents tsExport As System.Windows.Forms.ToolStripButton
Friend WithEvents tsImport As System.Windows.Forms.ToolStripButton
Friend WithEvents Timer1 As System.Windows.Forms.Timer
Friend WithEvents Panel1 As System.Windows.Forms.Panel
End Class

View File

@@ -0,0 +1,325 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="ToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="tsPrint.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAATRJREFUOE+Nk81K
w0AUhacP0218gGwESbJ152sEt24EEUSwBlRQxFJUWlQkFawttI1EBXVjUdDszEJQ/MGNILgwR87AQJKG
OoGPMPd+594sJiWRe/b6t8jX0uepibHSqL7ggCRJCvlvuBxM6ev7pxCtATPzHg5PThE/f2Zgjb2hz59b
XEYaStX9NsLBYwbW2Mv7YqGyAr/Vk5TLZS2Uz6yorG7gqB1IDMPQQvnMirXNGlrdM4lt21oon1mxtdNA
L7yUuK6rhfKZFfUDH57n4eL6BkEQaEGXMCv84w4Gdw+SOI61oMulzIpOP5QHYlmWFq9vHxhvToJZsb1b
RxRFEsdxMD27hPVaoxD26CifWaG2822aJqrNczy9vKN7dZ+BNfbopDNDN5P3/TdBIVr/AqVR5Df+AR+9
OgdeCi45AAAAAElFTkSuQmCC
</value>
</data>
<data name="tsPrevious.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAwJJREFUOE91k11M
01cYxl+n4BLC1vEh4hDxxtVEzYxfURNDNJkOMDUVhCrQdkEKzkb5SGOlkQ7j+KhYcP/SgYJAUTsV+YoO
NytgnDdbbMTE7GKKXuhmdsHihYma+PPfYnSAPsnJOTk5v+e878lzZshUVYpGZso2+Uh0MkNdz1IPIA/U
eUTKpX3a+Ukb34kzvnrOeEG3hbqAm8ZAE8eveXEMOsk6n0OcJ35c3Kr5e+WUU7v8eXhHWjnUfwSrvxyL
bx/mtmIKuqyU9zk4EnCxumstcly1mSSnuHdfKMJ9VWHfTza+9ZdhbLGws97Mwa5Kst355HSayT1XSNVQ
HSvPrEEUMU14VEqK9ofFKEMtYXjP2VLyWwox1Bu5/88YIXXcOEP6iSz0F/PI7DXh/K2WGG9sqB2NiFp6
1ZXvsXU71JtD8G5yVPjeGzhkUNFXxVedejL6DWQMGDBf3Yv+5xykSfZLVG3UmGf4BHvVno3qzVPhgnNW
Ztli+NgeT1TFXKKd8/jUuwDdJQPilR7RNi2mZvAYxWdL2Fad/bbscO3v0aFfDjPfo0V/JRf5UYbkC6+W
w5dqMfqKiLUkE3w4+iE2vF897GJZ+ypM1y0TBgmelPEDvZVElsYh1k/Q7E/i94e3ef7yVXicDl5gp9/E
N92F6Hx61rdtYPOvadhu2ZFm1UDqpCfNu52IsljErkEqNGgcCxj5K8i/T1+ER1FPCan+TWTdyMIYzKd4
tAjzTXPIQM3DUTFplaVoa1aGYamNYWZNHIlVixi8e4t7T57hGmlGd1nHnrsWDoyV4nncwPrLaqC8khKO
QmTj7GDqyS0kH12CuGKIUBLQNCSzyLWcHafNbO5MJ+/mLg4+KKPtPwXHn7ZQ/6fehdEtKRFK5Hiq72u0
rWvCBp+dXMhC3xJWnF9HWiCDwtECPH+7UR7VE90RHVRxNUT/lyJfRjbNDmp9y9jSl8mGnnQ2DmSgDxiw
/lGC/Y4d3fDWiYebBk82Mqm9Bee0J5LY+TlJXfNJ8M2dCE3z9J/4GuhC9ZQ1As+4AAAAAElFTkSuQmCC
</value>
</data>
<data name="tsNext.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAwtJREFUOE91k39I
1Gccxz9lYmQ2U6KtmLtWTLdZOxlkaYpkmtrKH21C2vLXaZbzvJtuWkorr0uds8s8vR+kpgdqpZTCmWyN
W/0xWMy52GB/bHSw0QgirpjMaGOvfb9fVyywN7x54Hme9+v59XkWyUKySIos1ixPvUSuiFm+X3D+085m
yQltDfWnD2RQ723kI+8R6rz1HJqoZutAIsFngn1iE/3CkGaxJZ1LpusrJy1XO6gdPUqlp4ZyTzXGSx9z
bNLK8WtWNvS9hpyV4mchJ8S0TQk7rvdqwQ9GatlvL6OwowSD/TB5ZwvZP1KBYcyIxddOrGcT0qUcUdMn
otN1rgs41fClo1QN11IxZGSP9T1m52Y1V/bVkNXzLnvHDrBv3EDTDQvLXMv88wBl68ZxM03jzVQpK6vh
kqHDZFlz+ePRLKrUttRTReq5bHZPFFD+pYmdE+8gDuUoy1vCZlw3+qgeqaPIfZDslnwyT+WSdDKdTHse
gT8faBC1je/azvJTa4ga2Ej+VJEKuCwxjtdp/7yTQ8Nmsq353L7r1wIL6cHcQ7a7s1jriCZnqgBxik+i
nTFYJtso9lTyqjH2ueEnAw1TTbzZ9zbvXy9HXArg5e4oDRB5RIdUhKG3JJBi30Wqaw+ZvXnM3PmRx3//
o3niJy8J/Uns+CID07d18wDpEN/e3kLEtAJpCEeOhbPo00iWNq7C+fUQ92f/0jz6g5f04Z0U3iyg9LtS
TNNmFWAT+UyK43q2sN76FtKoAFojCOpaRWjji/jvzWkenB4nYySDiltl1P1Sw5nf2knwblUvcb4WgjqD
/GnubF44GYW0RxBsX82K5rWUXvyQ+skWkgdSKJo+QIPfjOu+Dduvbf9t/0k9KvUd3hMRSBvM4SXlVVTA
SreOV5xvoB+MZ5dvN2W3Sjj9eyvddzoIOR8SUFbXPVvOdtGHOEICiRfS2HE5l7gLycSNbSN1KgvDNwdp
+7kVw80Sws6HzYj7eR/KJuHSLTYVFD0cS9zoZuKvJLJpTE/kYKRfubTj0q/M+Z/+Bc5J9EZzI7QTAAAA
AElFTkSuQmCC
</value>
</data>
<data name="tsZoomOut.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAmNJREFUOE+Nk99P
klEcxuvSq5oXXfsHdOFc46Ybty7cummrARtd8A5fYc2pL1QSaaMgyxnypnOQRZBmVGyMZaVltdnImrIF
y5bIJEWs+GWi4K8Ins6BLnxHus727D3be87n+zzf787+fTuWnrdWHaio0Ofy+arKykO1yUQ8kEilApm1
zMDdno7xnWfL9ub+Qb7P/giu5168nPiCN5NzcL/y49aDETS3d0Far+F3BZis9/g7zmFMBCJYiG3h23Ie
33/msZjMIbiYRb97Cmd0JkjqOUcZpM/hqjb3D2FyOop4uoDkGkpaBRJE8TQwE92C0fYODec7cEreWCuA
tHWYHc7ht4itFLC0DCwkQKoDKQKhoqA40YgvDW23CzKV1iMAaA0m/7gvVDy8ki2JVo0kgWiq5IJCPoYL
4J1TkDdfggDQdPE6fJ8XixfXNoDjrWEcawrgKOvFkdOjOHzyMebjwKcIcH80CPasUQhgGtvmX7+fRmYT
2Ngi2i4pS/YUmF4H5kksUgMPx0Jo1HUKAVJW7bntfEYuFbCdA34R0e/mX8gqgdAoM0uA/YkP6vYbfkEE
2lUl6e5cJIZ8AUXlfpcg1AmN9pVEmAxm0W1zQ6PvYspGSV0YbtrxI0naTxaFUCfrJAadiG82DWPPAJSc
DmKxuLoMcELeclDKnvOoL/Nwv/AW3YTIGKbDKYx9CMEy9BQNXDu02guoq6tbYVm2HEKpYkULo9Rc8bde
7SUVHejsG8S1XpvfYLIyHo+HsVgskEgke0P2ejAqlUoAkclk/3byvxCRSJTY84Xu9lOhUDAcx6Gmpob5
A8rd9wxr3WF7AAAAAElFTkSuQmCC
</value>
</data>
<data name="tsZoomIn.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAmNJREFUOE+Nk99P
klEcxuvSq5oXXfsHdOFY86Ybty7YummrgRtd8A4JFk5BKom0URDlDH3VMYgiSXNUbIxlpdmPzUbWkC1Y
tlSmIWolP0wUNIzg6RzeLnxHss727D3be76f5/l+z87+fbuWgbXXHKiqMuQLhZrq6kP1yUQ8nEilwpnN
zODdPvPE7rNl+x7HEGsdeAjPMz/GJz/jdWAe3pch3HKPoqWjCw2NWnZPgMV+j73jHsFkOIbF1Ry+rhXw
7UcBS8k8ZpeycHincFZvgbhR4yqDWF2e2h7HMALTy4ini0hugtMGkCCKp4GZ5RxMzrc4c8GMU9Kmeh6k
3dzjco+8wep6EStrwGICxB043raA1F9QnIBGg2nouj2QKHU+HkBntIQmgpHS4fUsJ+p6rDmM5RSXgqb5
sFAE656CtOUyeIDmSzcQ/LRUKtzc5pxp8VG5H0dOj+HwyUeIxoGPMeD+2Czk50x8ANPUHn31bhqZn8B2
jmiHEy2mwPQWECVtEQ88eBFBk76TD2iQt/puu5+SoiJ28sAvIvqlzlkC3CAQ2srMCjDwOIjWjpshXgt0
qgoy3fnYKgpFlJT/zUFoEtraF9JCYDaLbqcXWkMXU3aVNIWxdwDfk2T8ZFEITbJFEtAbCc6lYeodhEKt
h0gkqi0DnJCqDzbIz/tar7DwPveX0kRiSUwvpDD+PgLb8BMoNB3Q6S5CKBSuq1SqcgilimRqRqG9Gmq7
1g9jnwud1iFc73eGjBY74/P5GJvNBrFYXBlS6cEolUoeRCKR/DvJ/0Lq6uoSFV/oXj9lMhmj0WggEAiY
P7jh8TZUkcROAAAAAElFTkSuQmCC
</value>
</data>
<data name="tsRotateCC.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgFJREFUOE+dkm9r
01AUxqOCCL4ZfoGJVWN1s9LZdWu7NBVG0TcJiivVyUo3V8Y624Ru9o+4ou8E6ScQ/AZjnyCIbmU2kg3T
pq5NokzfWt9aCs+SFKWWSKEXDtx7z3N+59yHe+Lqonyu9mbsJ9G3Rply7OyZk8yp08QIOgTxu9Mh2u32
tiF7+2079Ouv3LkgiaOMMPLnwnF3h51YrOhM/hDscxWzGw0E+UME0k14EnWQkXLLwQhsD2Af7vmyZEKM
ZCnMy4i81EBxCnwpBXSmiRleg59T4Us3EDD2rpgEQ9+FOBf2kXitWmQmp4DdbGIyKeN2XsPMEwXXHlZ0
Z1QUyHlRmliWQWW+WmHqrclNwNyLBuKvdNwrqvAmq7hT0OBZPmhdnNtN91rjiLynzcJQ9ghTyTou3X8X
swA0V8OtjIKptSrCeRU3Hx8YyQ83+o01z5ejO6xnpYpQ7gjkg92tLoCvwbP6GdPGm8M5HY7ont5rbD+I
NDyj8z9wJbonWIDZDcNlrg4f9wWTKRXulSYuRLrG2k1BPioXQ4XvGIuLkgX4X5gQO4AzLrJUVsP40ifB
Lj/wzpWo0FRWxfWlj1sDxXYC95qUptYbGE+IsaEAXl4ueTNKy5WSbD0aCPU+VaTp9WpxoNBOENxUzvsL
dT04bPfAM6XkLyj0UN3NIl9G/ueHHgPbqRVfZpRR6AAAAABJRU5ErkJggg==
</value>
</data>
<data name="tsRotateC.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAhFJREFUOE9jZEAC
8v7rBZj/sCRwc3H6szAzMvz/y8zw/c/fD7///Nl4b7P7AmS1ILa+/34BuJiyz9YA88RD7yPrr/0Pqb/9
363s5n/Xslv/Pcpv/7fLufxfO+LwfTX//QEwDfrx+wU0Ey7+B/Pl3TYF+BSc+h/Xfu+/Z8XN/z7Vd/57
Vt7971h8+79J1rX/pjnX/1sX3P1vkHDuv2b4oX6QZsOE4+fBBoCcbR5+4H1S173/0a13/7vmnfuvG37w
vGbIgf3KwYfuGydf/G+ed+e/Se71/7Yl9/6bZ177rx5+/L1rxYP/YANUfbcnxDZe+5/c8/C/WfiR9/Le
2x2Q/SrtvadAPfL0f0ugC6xKb/13qnr436Xy0X/f5icQAwxCdq1P7X3w37Pg/H9lnx1wP6IG7n4D7bjz
/23LHvy3rbr736X+4X+P5kcQA0xjD+5P6n743yD8wHn0UIbx5YGhrRxx8r5l0YP/JqV3/5uU3f1vAfOC
UfTh+1Et9/6rB+9uwGYASLNS+OnzFoUP/ltXPv5vWf3wv3Xto/92dVAvgFzgXXbtv2YYIoqQDQI5Ex9m
0A3Zu94m48J/YWfUwMPlHQxxJd+dCVoRJ/+LOO0oIFoTskJ++/UC4u6H3ou77+4nywCQJnHX3Q3i7ntw
xgJBg/nt9wNdsR3oiv0KBBXjUgD0goOU5z7yvQEyWMprvwGpLgAAMI4O1j/5+DAAAAAASUVORK5CYII=
</value>
</data>
<metadata name="tsBottom.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>213, 17</value>
</metadata>
<metadata name="tsBottom.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>213, 17</value>
</metadata>
<data name="btSearch.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAldJREFUOE+Nk99L
U2EYx1tRd9H+hP0JYxe79s5LJZjSIjaOyKFhHhVz7Qe0MeewX3MOzyiFrUDdReygRSWWdrMw1NRgZJKV
zg3dr7PN6dTN8+09G4EHnXXg4Twv5zwfPu/zPq/swonH8dBbd/WanJFdvKS4fEWmiEYTy/lcdqJwmAk8
93iyJ/+V5PfdbrnL84wbHpvA5MwiZufXMUMi9P4L+n3joGgj36AzKGsC+h77uNGJD/j6I4VYqoxtXkA8
I2AjUcLi9wzuPQmhuRbk0dCLxqHAS6xuZJHMAck8kCIh5gkS21lgaj6JTtcobrTenT1lYe4d4F4RbbEg
mgJ+J4CtdBXwF7QWF8CGvqG1uxcNOlohgRj7vPxCJIr0LpDdA3IkxFyEbSSJBTH4uUMsFnNot/nQ3MLU
SQC3exxYiGxWCneLQOGg+s7vA5kC8IsYrcaAz2tH6Hb5cZM2SgH6NuvSdHgFe6SweAQckCgeorIWIaLV
6hYQjuzB/GAELYxFCtBQ7e5+3xgpOkbpGCiVgcNSFSLaiI1ciwOvP23C6GL5U02kjW6FeEQf51YgCAIE
AGUCEk3yZCtiL5bXi2BH38LkcNvOnIXrurZGqtOOyekw8rv7BCBUDGLpMuYiCTwNTsHkHESPfYDTaDRn
D5RGxyhv3bHOdtk9GAm+QSA0g+HgO7h847zJ6bF12QeXzBYr6uvreYPhnKnUMWYlY+7VW5xum8XlrfP7
/XJRm+M4PcuyaGpq+jek1szTNC2BaLXa2vfjfyBqtTpR84Kd94GiKH1HRwdUKpX+D2ip3HdylLCsAAAA
AElFTkSuQmCC
</value>
</data>
<data name="btNext.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQU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FD0cS9zoZuKvJLJpTE/kYKRfubTj0q/M+Z/+Bc5J9EZzI7QTAAAA
AElFTkSuQmCC
</value>
</data>
<data name="tsExport.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAltJREFUOE+Nkctv
ElEYxUeNiUv+hPoXuNMmpNa6cWGMGtOtrRtoIAQWTSAhkO66pGlEF8Q0odEEU4Uij7bSTmnBAWbMRO0j
KUVmCk1rGwPlMbzE49ypklYt6SS/zLnnfvd88829QJ3xZL3XVBfrdRqXKAGXrzy5+vBT8azaf/yst18l
zqr5XEgNAtHEO1dAlr6vEt/f5XNL99DY0SgQTTyy1zXk+PAdXi5GaeMxcKBHe0+naOKRva4hYmiAF8MD
+AOEQdQ3HnTWii/X/PcrWJZ1cBwHhXgIor8XWLuJGtenaJ/PB4/HA7fbDZfL5TgVwvN8jwwqpQZq1R84
2s8i+6YXjUQ/StE+RRcLEg4PShCFPTidzzA+Pt7TCZG7T+2IeeVwq9FG5VDA1ks1vvlvY/ftLUVLUhOV
ch27+e/w+0Ow2+1TSoDcWXWye2Y7j+J+Busv+k4RmkuBXuaUgM3NLKxWK4xGo4qSu4+ltzJK97+RKi1U
y02Uj+qdEUhAZnsXk5NOaLXaMYphmEIiySKV4sCyH8FyMiyHZDIFhkkgFosjurICml5GJLKI+fkFhMJh
BAIBTE9PF0gAypUqKlUJVRlJqkGq1VA7A6EkIF1No/mziYmJCVDBYFAJeD0zhxnvAryzEfj8i5h9twh/
YOk3tPymkd7+iqHlYQytDSPXysFms4Ei90oCnj5/hchSHHSUQXQ1idV4CjHCBxZx5pjPX9bxaG4Q1xM3
IDQE6PV6UA6HA+22fHXnHOHkaBqNBpTZbC5YLBaMjo7CZDLBYDBAp9NhZGSE/GWQoi4UfgFO5IMdoefy
GgAAAABJRU5ErkJggg==
</value>
</data>
<data name="tsImport.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAllJREFUOE+VkN1L
U3Ech+c/EHoRdBFkN5oQoQQmvWHSC9VViEEQaBBOFNHA0PAFLwIvZ5JFeSHNKJCFbW5OZTo3nXM7i0VW
gvNlpmZlOnPbmc7W0znHFAsNPfBwPud7vuf58Dtxqh2uw88T2Ppq8mYgbqfdbecpuv1ctx3lqiUJOe/p
Y3k5w3iE+6O53Hl7DTnvWXDGfJwHU/eo+qhGzrsSpOmTvWn6FDa4O3yL2+7szef1ebJ3W5kgCBq728YF
QyZJukNkdaVzw3GFnP5LSpZnZ1szeKp9QlNTk+YvidfrTZQgtLzK16VFzpvOcfDlATJMxxTknNWeycTn
Gab8czQ2PqKuri5xUyK1N3+amiES/snaaoyF0CKn9SdJeLZP4ZSUvyzNEwquMDuzgMHQQU1NTbMikJrj
N9plwfiYJBKjTH+fI7U1lYuvLmO2D9LR6cba51EEIyOTVFZWUlJSEq+S2mt9o+NK+7+IoTXCwSjBHyss
BUTmvy0rgvGxWRoaGlGr1bUqp9MZGHIJuN0eBOENgkdC8OByuXE6hxgYcGCz27Fa+7BYeujq6qbDbMZo
NNLS0hKQBQRDYUJhkbCEKEYQIxEiO+Bf9uML+4j+ilJfX4/KZDIpglZdJ7q2btr0Fl4betC392Aw9v7B
Kt2t+MYmyO3LI/d9HtNr01RXV6PSarWK4OHjF1h6HVhtTmz9LvodbgZkBgUcznXeDX8guzOH9KET+Ff9
FBUVodJoNMRisV0fYevR8vPzUZWXlwcqKiooKyujtLSU4uJiCgsLKSgokP8y8tJ/CPwGaoI/8ifGcWcA
AAAASUVORK5CYII=
</value>
</data>
<metadata name="OpenFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>315, 17</value>
</metadata>
<metadata name="SaveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>457, 17</value>
</metadata>
<metadata name="Timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>124, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,977 @@
Imports System.Text.RegularExpressions
Imports System.Drawing.Imaging
Imports System.Drawing
Imports System.Windows.Forms
Imports PDFLibNet
Imports System.ComponentModel
Public Class PDFViewer
Private mOriginalFileName
Private mPDFFileName As String
Private mPDFPageCount As Integer
Private mCurrentPageNumber As Integer
Private m_PanStartPoint As Point
Private mBookmarks As ArrayList
Private mAllowBookmarks As Boolean = True
Private mUseXPDF As Boolean = True
Private mPDFDoc As PDFLibNet.PDFWrapper
Private FromBeginning As Boolean = True
Private XPDFPrintingPicBox As New PictureBox
Private mContinuousPages As Boolean = False
Private PageInitDone As Boolean = False
Private ScrollBarPosition As Integer = 0
Private ScrollUnitsPerPage As Integer = 0
Private ContinuousImages As List(Of System.Drawing.Image)
Private mUserPassword As String = ""
Private mOwnerPassword As String = ""
Private mPassword As String = ""
'Optimal render
Private mLastPageNumber As Integer
Private mResizeStopped As Boolean = False
Private mResizeCheckTimer As New Timer
Private mPDFViewerHeight As Integer
Private mPDFViewerWidth As Integer
Private mRotation As List(Of Integer)
Public Property FileName() As String
Get
Return mOriginalFileName
End Get
Set(ByVal value As String)
If Nothing = value Or value = "" Then
Exit Property
End If
mOriginalFileName = value
mUserPassword = ""
mOwnerPassword = ""
mPassword = ""
Dim userPassword As String = Nothing
If ImageUtil.IsTiff(value) Then
'Tiff Specific behavior
InitBottomToolbar("TIFF")
ElseIf ImageUtil.IsPDF(value) Then
Cursor.Current = Cursors.WaitCursor
If iTextSharpUtil.IsEncrypted(value) Then
FileIsEncrypted:
Dim frmPassword As New Password
Dim result As DialogResult = frmPassword.ShowDialog()
If result = DialogResult.OK Then
If Not frmPassword.OwnerPassword = "" Then
mOwnerPassword = frmPassword.OwnerPassword
If iTextSharpUtil.IsPasswordValid(value, frmPassword.OwnerPassword) = False Then
MsgBox("Owner password is incorrect.", MsgBoxStyle.Critical, "Incorrect Password")
Cursor.Current = Cursors.Default
Exit Property
Else
mOwnerPassword = frmPassword.OwnerPassword
mPassword = mOwnerPassword
End If
End If
If Not frmPassword.UserPassword = "" Then
If iTextSharpUtil.IsPasswordValid(value, frmPassword.UserPassword) = False Then
MsgBox("User password is incorrect.", MsgBoxStyle.Critical, "Incorrect Password")
Cursor.Current = Cursors.Default
Exit Property
Else
mUserPassword = frmPassword.UserPassword
mPassword = mUserPassword
End If
End If
End If
End If
If mUseXPDF Then
If Not Nothing Is mPDFDoc Then
mPDFDoc.Dispose()
End If
Try
mPDFDoc = New PDFLibNet.PDFWrapper("")
If mOwnerPassword <> "" Then
mPDFDoc.OwnerPassword = mOwnerPassword
mPassword = mOwnerPassword
End If
If mUserPassword <> "" Then
mPDFDoc.UserPassword = mUserPassword
mPassword = mUserPassword
End If
mPDFDoc.LoadPDF(value)
Catch ex As System.Security.SecurityException
GoTo FileIsEncrypted
Catch ex As Exception
If Not Nothing Is mPDFDoc Then
mPDFDoc.Dispose()
End If
GoTo GhostScriptFallBack
End Try
InitBottomToolbar("XPDF")
Else
GhostScriptFallBack:
InitBottomToolbar("GS")
End If
Else
Me.Enabled = False
End If
mPDFFileName = value
InitViewModes()
InitPageRange()
InitRotation()
InitializePageView(ViewMode.FIT_WIDTH)
If mAllowBookmarks And ImageUtil.IsPDF(mOriginalFileName) Then
InitBookmarks()
Else
HideBookmarks()
End If
DisplayCurrentPage()
tscbZoom.SelectedIndex = 1
Me.Enabled = True
Cursor.Current = Cursors.Default
End Set
End Property
'Public Property ContinuousPages() As Boolean
' Get
' Return mContinuousPages
' End Get
' Set(ByVal value As Boolean)
' mContinuousPages = value
' End Set
'End Property
Public Property UseXPDF() As Boolean
Get
Return mUseXPDF
End Get
Set(ByVal value As Boolean)
mUseXPDF = value
End Set
End Property
Public Property AllowBookmarks() As Boolean
Get
Return mAllowBookmarks
End Get
Set(ByVal value As Boolean)
mAllowBookmarks = value
If value = False Then
HideBookmarks()
End If
End Set
End Property
Public ReadOnly Property PageCount(ByVal FileName As String)
Get
Return ImageUtil.GetImageFrameCount(FileName)
End Get
End Property
Public ReadOnly Property Print(ByVal FileName As String)
Get
PrinterUtil.PrintImagesToPrinter(FileName)
Return 1
End Get
End Property
Public Sub SelectFile()
OpenFileDialog1.Filter = "PDF or TIFF files (*.pdf;*.tif)|*.pdf;*.tif"
OpenFileDialog1.FileName = ""
OpenFileDialog1.Title = "Select a PDF or TIFF file to open"
OpenFileDialog1.Multiselect = False
OpenFileDialog1.ShowDialog()
FileName = OpenFileDialog1.FileName
End Sub
Public Function OCRCurrentPage() As String
Cursor.Current = Cursors.WaitCursor
Dim TempFile As String = System.IO.Path.GetTempPath & Now.Ticks & ".txt"
OCRCurrentPage = ""
Try
AFPDFLibUtil.ExportPDF(mPDFDoc, TempFile, mCurrentPageNumber, mCurrentPageNumber)
OCRCurrentPage = System.IO.File.ReadAllText(TempFile)
System.IO.File.Delete(TempFile)
If Regex.IsMatch(OCRCurrentPage, "\w") = False Then
GoTo OCRCurrentImage
End If
Catch ex As Exception
If Regex.IsMatch(OCRCurrentPage, "\w") = False Then
GoTo OCRCurrentImage
End If
End Try
Cursor.Current = Cursors.Default
Exit Function
OCRCurrentImage:
Try
OCRCurrentPage = TesseractOCR.OCRImage(FindPictureBox("SinglePicBox").Image, TesseractOCR.Language.English)
Catch ex As Exception
'OCR failed
End Try
Cursor.Current = Cursors.Default
End Function
Private Sub ConvertGraphicsToPDF()
OpenFileDialog1.Filter = "Image Files(*.BMP;*.JPG;*.GIF;*.PNG;*.TIF)|*.BMP;*.JPG;*.GIF;*.PNG;*.TIF"
OpenFileDialog1.FileName = ""
OpenFileDialog1.Title = "Select multiple image files to convert to PDF"
OpenFileDialog1.Multiselect = True
If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
Dim exportOptionsDialog As New ExportImageOptions(OpenFileDialog1.FileNames)
exportOptionsDialog.ShowDialog()
Try
FileName = exportOptionsDialog.SavedFileName
Catch ex As Exception
'do nothing
End Try
End If
End Sub
Private Sub PDFViewer_ControlRemoved(ByVal sender As Object, ByVal e As System.Windows.Forms.ControlEventArgs) Handles Me.ControlRemoved
If Not Nothing Is mPDFDoc Then
mPDFDoc.Dispose()
End If
End Sub
Private Sub PDFViewer_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
If Not Nothing Is mPDFDoc Then
mPDFDoc.Dispose()
End If
End Sub
Private Sub PDFViewer_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Do something on control load
HideBookmarks()
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Me.Height = mPDFViewerHeight And Me.Width = mPDFViewerWidth Then
If mResizeStopped = False Then
DisplayCurrentPage()
mResizeStopped = True
End If
Timer1.Enabled = False
End If
End Sub
Private Sub PDFViewer_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
If PageInitDone = True Then
CenterPicBoxInPanel(FindPictureBox("SinglePicBox"))
End If
End Sub
Private Sub tsPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsPrevious.Click
mLastPageNumber = mCurrentPageNumber
mCurrentPageNumber -= 1
DisplayCurrentPage()
End Sub
Private Sub tsNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsNext.Click
mLastPageNumber = mCurrentPageNumber
mCurrentPageNumber += 1
DisplayCurrentPage()
End Sub
Private Sub tsZoomOut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsZoomOut.Click
Dim objPictureBox As PictureBox = FindPictureBox(mCurrentPageNumber)
ImageUtil.PictureBoxZoomOut(objPictureBox)
objPictureBox.Refresh()
'tscbZoom.Text = GetCurrentScalePercentage() & " %"
DisplayCurrentPage()
End Sub
Private Sub tsZoomIn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsZoomIn.Click
'If GetCurrentScalePercentage() > 500 Then
' Exit Sub
'End If
Dim objPictureBox As PictureBox = FindPictureBox(mCurrentPageNumber)
ImageUtil.PictureBoxZoomIn(objPictureBox)
objPictureBox.Refresh()
'tscbZoom.Text = GetCurrentScalePercentage() & " %"
DisplayCurrentPage()
End Sub
Private Sub tsPageNum_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles tsPageNum.KeyPress
If (Asc(e.KeyChar) = Keys.Enter) Then
If tsPageNum.Text = "" Then
mCurrentPageNumber = 1
Else
mCurrentPageNumber = tsPageNum.Text
End If
DisplayCurrentPage()
Else
e.Handled = TrapKey(Asc(e.KeyChar))
End If
End Sub
Private Sub tsPageNum_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsPageNum.Leave
mCurrentPageNumber = tsPageNum.Text
DisplayCurrentPage()
End Sub
Private Sub tscbZoom_Change(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tscbZoom.SelectedIndexChanged
Select Case tscbZoom.Text
Case "Fit To Screen"
If mContinuousPages Then
InitializePageView(ViewMode.FIT_TO_SCREEN)
Else
ApplyZoom(ViewMode.FIT_TO_SCREEN)
End If
Case "Actual Size"
If mContinuousPages Then
InitializePageView(ViewMode.ACTUAL_SIZE)
Else
ApplyZoom(ViewMode.ACTUAL_SIZE)
End If
Case "Fit To Width"
If mContinuousPages Then
InitializePageView(ViewMode.FIT_WIDTH)
Else
ApplyZoom(ViewMode.FIT_WIDTH)
End If
End Select
CenterPicBoxInPanel(FindPictureBox("SinglePicBox"))
DisplayCurrentPage()
End Sub
Private Sub tsPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsPrint.Click
If ImageUtil.IsPDF(mOriginalFileName) Or ImageUtil.IsTiff(mOriginalFileName) Then
PrinterUtil.PrintImagesToPrinter(mOriginalFileName)
End If
End Sub
Private Sub tsRotateCC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsRotateCC.Click
mRotation(mCurrentPageNumber - 1) -= 1
ImageUtil.RotateImageCounterclockwise(FindPictureBox(mCurrentPageNumber))
End Sub
Private Sub tsRotateC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsRotateC.Click
mRotation(mCurrentPageNumber - 1) += 1
ImageUtil.RotateImageClockwise(FindPictureBox(mCurrentPageNumber))
End Sub
Private Sub tsExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsExport.Click
If ImageUtil.IsPDF(mOriginalFileName) Then
Dim exportOptionsDialog As New ExportOptions(mPDFFileName, mPDFDoc, mPassword)
exportOptionsDialog.ShowDialog()
ElseIf ImageUtil.IsTiff(mOriginalFileName) Then
Dim FileArray(0) As String
FileArray(0) = mPDFFileName
Dim exportOptionsDialog As New ExportImageOptions(FileArray)
exportOptionsDialog.ShowDialog()
End If
Me.Focus()
End Sub
Private Sub tsImport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsImport.Click
ConvertGraphicsToPDF()
End Sub
#Region "Constraints"
Private Sub CheckPageBounds()
If mCurrentPageNumber >= mPDFPageCount Then
mCurrentPageNumber = mPDFPageCount
tsNext.Enabled = False
ElseIf mCurrentPageNumber <= 1 Then
mCurrentPageNumber = 1
tsPrevious.Enabled = False
End If
If mCurrentPageNumber < mPDFPageCount And mPDFPageCount > 1 And mCurrentPageNumber > 1 Then
tsNext.Enabled = True
tsPrevious.Enabled = True
End If
If mCurrentPageNumber = mPDFPageCount And mPDFPageCount > 1 And mCurrentPageNumber > 1 Then
tsPrevious.Enabled = True
End If
If mCurrentPageNumber = 1 And mPDFPageCount > 1 Then
tsNext.Enabled = True
End If
If mPDFPageCount = 1 Then
tsNext.Enabled = False
tsPrevious.Enabled = False
End If
End Sub
#End Region
#Region "Helper Functions"
Private Function GetImageFromFile(ByVal sFileName As String, ByVal iFrameNumber As Integer, Optional ByVal DPI As Integer = 0) As System.Drawing.Image
'Cursor.Current = Cursors.WaitCursor
GetImageFromFile = Nothing
If mUseXPDF And ImageUtil.IsPDF(sFileName) Then 'Use AFPDFLib (XPDF)
Try
GetImageFromFile = AFPDFLibUtil.GetImageFromPDF(mPDFDoc, iFrameNumber + 1, DPI)
Catch ex As Exception
InitBottomToolbar("GS")
GoTo GhostScriptFallBack
End Try
Else 'Use Ghostscript
GhostScriptFallBack:
If ImageUtil.IsPDF(sFileName) Then 'convert one frame to a tiff for viewing
GetImageFromFile = ConvertPDF.PDFConvert.GetPageFromPDF(sFileName, iFrameNumber + 1, DPI, mPassword)
ElseIf ImageUtil.IsTiff(sFileName) Then
GetImageFromFile = ImageUtil.GetFrameFromTiff(sFileName, iFrameNumber)
End If
End If
ImageUtil.ApplyRotation(GetImageFromFile, mRotation(iFrameNumber))
End Function
Private Sub InitPageRange()
mPDFPageCount = ImageUtil.GetImageFrameCount(mPDFFileName, mPassword)
mCurrentPageNumber = 1
End Sub
Private Sub InitBookmarks()
TreeView1.Nodes.Clear()
Dim HasBookmarks As Boolean = False
Try
If mUseXPDF Then
HasBookmarks = AFPDFLibUtil.FillTree(TreeView1, mPDFDoc)
AddHandler TreeView1.NodeMouseClick, AddressOf AFPDFLib_NodeMouseClick
RemoveHandler TreeView1.NodeMouseClick, AddressOf ItextSharp_NodeMouseClick
Else
HasBookmarks = iTextSharpUtil.BuildBookmarkTreeFromPDF(mOriginalFileName, TreeView1.Nodes, mPassword)
AddHandler TreeView1.NodeMouseClick, AddressOf ItextSharp_NodeMouseClick
RemoveHandler TreeView1.NodeMouseClick, AddressOf AFPDFLib_NodeMouseClick
End If
Catch ex As Exception
'Some bookmark structures do not parse from XML yet.
'TODO
End Try
If HasBookmarks Then
ShowBookmarks()
TreeView1.ExpandAll()
TreeView1.SelectedNode = TreeView1.Nodes.Item(0)
Else
HideBookmarks()
End If
End Sub
Private Sub InitBottomToolbar(ByVal Mode As String)
If Mode = "TIFF" Then
btSearch.Visible = False
btNext.Visible = False
tbSearchText.Visible = False
ToolStripSeparator5.Visible = False
tsExport.Visible = True
tsExport.ToolTipText = "Export TIFF file to the PDF file format"
ElseIf Mode = "GS" Then
btSearch.Visible = False
btNext.Visible = False
tbSearchText.Visible = False
ToolStripSeparator5.Visible = False
tsExport.Visible = False
ElseIf Mode = "XPDF" Then
btSearch.Visible = True
btNext.Visible = True
tbSearchText.Visible = True
ToolStripSeparator5.Visible = True
tsExport.Visible = True
tsExport.ToolTipText = "Export PDF to another file format"
End If
End Sub
Private Sub HideBookmarks()
TreeView1.Visible = False
TableLayoutPanel1.SetColumnSpan(TreeView1, 2)
TableLayoutPanel1.SetColumnSpan(Panel1, 2)
TableLayoutPanel1.SetColumn(Panel1, 0)
TableLayoutPanel1.SetColumn(TreeView1, 1)
End Sub
Private Sub ShowBookmarks()
TreeView1.Visible = True
TableLayoutPanel1.SetColumnSpan(TreeView1, 1)
TableLayoutPanel1.SetColumnSpan(Panel1, 1)
TableLayoutPanel1.SetColumn(Panel1, 1)
TableLayoutPanel1.SetColumn(TreeView1, 0)
End Sub
Public Enum ViewMode
FIT_TO_SCREEN
FIT_WIDTH
ACTUAL_SIZE
End Enum
Private Sub InitRotation()
mRotation = New List(Of Integer)
For i As Integer = 1 To mPDFPageCount
mRotation.Add(0)
Next
End Sub
Private Sub InitViewModes()
tscbZoom.Items.Clear()
tscbZoom.Items.Add("Fit To Screen")
tscbZoom.Items.Add("Fit To Width")
If ImageUtil.IsTiff(mPDFFileName) Then
tscbZoom.Items.Add("Actual Size")
End If
End Sub
Private Sub InitializePageView(Optional ByVal Mode As ViewMode = ViewMode.FIT_TO_SCREEN)
Dim myFlowLayoutPanel As New FlowLayoutPanel
Panel1.SuspendLayout()
Panel1.Controls.Clear()
If mContinuousPages Then
myFlowLayoutPanel.Dock = DockStyle.Fill
myFlowLayoutPanel.FlowDirection = FlowDirection.TopDown
myFlowLayoutPanel.AutoScroll = True
myFlowLayoutPanel.Width = Panel1.Width - 20
myFlowLayoutPanel.Height = Panel1.Height - 20
myFlowLayoutPanel.WrapContents = False
AddHandler myFlowLayoutPanel.Scroll, AddressOf FlowPanel_Scroll
For i As Integer = 1 To mPDFPageCount
Dim ObjPictureBox As New PictureBox
ObjPictureBox.Name = i.ToString
ObjPictureBox.SizeMode = PictureBoxSizeMode.Zoom
ObjPictureBox.Height = myFlowLayoutPanel.Height - 14
ObjPictureBox.Width = myFlowLayoutPanel.Width - 14
ObjPictureBox.Location = New Point(0, 0)
AddHandler ObjPictureBox.MouseUp, AddressOf picImage_MouseUp
AddHandler ObjPictureBox.MouseDown, AddressOf picImage_MouseDown
AddHandler ObjPictureBox.MouseMove, AddressOf picImage_MouseMove
'ObjPictureBox.Image = New System.Drawing.Bitmap(1, 1)
'ShowImageFromFile(mPDFFileName, i - 1, ObjPictureBox)
myFlowLayoutPanel.Controls.Add(ObjPictureBox)
Next
Dim EndPictureBox As New PictureBox
EndPictureBox.Name = "0"
EndPictureBox.Height = 1
EndPictureBox.Width = 1
EndPictureBox.Location = New Point(0, 0)
myFlowLayoutPanel.Controls.Add(EndPictureBox)
ApplyToAllPictureBoxes(myFlowLayoutPanel, Mode)
Panel1.Controls.Add(myFlowLayoutPanel)
ScrollUnitsPerPage = FindFlowLayoutPanel().VerticalScroll.Maximum / mPDFPageCount
Else
Dim objPictureBox As New PictureBox
objPictureBox.Name = "SinglePicBox"
Panel1.Controls.Add(objPictureBox)
objPictureBox.SizeMode = PictureBoxSizeMode.Zoom
objPictureBox.Dock = DockStyle.None
objPictureBox.Height = Panel1.Height - 14
objPictureBox.Width = Panel1.Width - 14
objPictureBox.Location = New Point(0, 0)
AddHandler objPictureBox.MouseUp, AddressOf picImage_MouseUp
AddHandler objPictureBox.MouseDown, AddressOf picImage_MouseDown
AddHandler objPictureBox.MouseMove, AddressOf picImage_MouseMove
ApplyToAllPictureBoxes(Panel1, Mode)
End If
Panel1.ResumeLayout()
PageInitDone = True
End Sub
Private Sub ApplyZoom(ByVal Mode As ViewMode)
Dim oPictureBox As PictureBox = FindPictureBox("SinglePicBox")
If Mode = ViewMode.FIT_TO_SCREEN Then
Dim picHeight As Integer = oPictureBox.Height
Dim picWidth As Integer = oPictureBox.Width
Dim parentHeight As Integer = oPictureBox.Parent.ClientSize.Height - 14
Dim parentWidth As Integer = oPictureBox.Parent.ClientSize.Width - 14
Dim HScale As Single = parentWidth / picWidth
Dim VScale As Single = parentHeight / picHeight
If VScale > HScale Then
oPictureBox.Height = picHeight * HScale
oPictureBox.Width = picWidth * HScale
Else
oPictureBox.Height = picHeight * VScale
oPictureBox.Width = picWidth * VScale
End If
ElseIf Mode = ViewMode.FIT_WIDTH And Not Nothing Is oPictureBox.Image Then
oPictureBox.Width = oPictureBox.Parent.ClientSize.Width - 18
Dim ScaleAmount As Double = (oPictureBox.Width / oPictureBox.Image.Width)
oPictureBox.Height = CInt(oPictureBox.Image.Height * ScaleAmount)
ElseIf Mode = ViewMode.ACTUAL_SIZE And Not Nothing Is oPictureBox.Image Then
oPictureBox.Width = oPictureBox.Image.Width
oPictureBox.Height = oPictureBox.Image.Height
End If
CenterPicBoxInPanel(FindPictureBox("SinglePicBox"))
'tscbZoom.Text = GetCurrentScalePercentage() & " %"
End Sub
Private Sub MakePictureBox1To1WithImage(ByRef oPictureBox As PictureBox, Optional ByRef newImage As Drawing.Image = Nothing)
If Not Nothing Is newImage Then
oPictureBox.Width = newImage.Width
oPictureBox.Height = newImage.Height
Else
oPictureBox.Width = oPictureBox.Image.Width
oPictureBox.Height = oPictureBox.Image.Height
End If
End Sub
Private Sub AutoRotatePicBox(ByRef oPictureBox As PictureBox, ByRef newImage As Drawing.Image)
Dim picHeight As Integer = oPictureBox.Height
Dim picWidth As Integer = oPictureBox.Width
Dim imgHeight As Integer = newImage.Height
Dim imgWidth As Integer = newImage.Width
If (picWidth > picHeight And imgWidth < imgHeight) Or (picWidth < picHeight And imgWidth > imgHeight) Then
oPictureBox.Width = picHeight
oPictureBox.Height = picWidth
End If
End Sub
Private Sub CenterPicBoxInPanel(ByRef oPictureBox As PictureBox)
ImageUtil.RecalcPageLocation(oPictureBox)
End Sub
Private Delegate Sub ShowImage(ByVal sFileName As String, ByVal iFrameNumber As Integer, ByRef oPictureBox As PictureBox, ByVal XPDFDPI As Integer)
Private Sub FlowPanel_Scroll(ByVal sender As Object, ByVal e As System.Windows.Forms.ScrollEventArgs)
ScrollBarPosition = e.NewValue()
Dim ImagesWereLoaded As Boolean = False
For i As Integer = 0 To 1
Dim pageNumber As Integer = (System.Math.Floor(ScrollBarPosition / ScrollUnitsPerPage) + 1) + i
If pageNumber >= 1 And pageNumber <= mPDFPageCount Then
If Nothing Is FindPictureBox(pageNumber).Image Then
FindPictureBox(pageNumber).Image = GetImageFromFile(mPDFFileName, pageNumber - 1, 72)
ImagesWereLoaded = True
FindPictureBox(pageNumber).Refresh()
End If
End If
Next
If ImagesWereLoaded Then
Dim lastPage As Integer = System.Math.Floor(ScrollBarPosition / ScrollUnitsPerPage) + 2
If lastPage > mPDFPageCount Then
lastPage = mPDFPageCount
End If
Dim firstPage As Integer = System.Math.Floor(ScrollBarPosition / ScrollUnitsPerPage) + 1
If firstPage < 1 Then
firstPage = 1
End If
ClearAllPictureBoxes(firstPage, lastPage)
End If
mCurrentPageNumber = System.Math.Floor(ScrollBarPosition / ScrollUnitsPerPage) + 1
UpdatePageLabel()
End Sub
Private Sub UpdatePageLabel()
tsPageLabel.Text = "Page " & mCurrentPageNumber & " of " & mPDFPageCount
tsPageNum.Text = mCurrentPageNumber
End Sub
'Private Sub DisplayCurrentPage()
' CheckPageBounds()
' UpdatePageLabel()
' ShowImageFromFile(mPDFFileName, mCurrentPageNumber - 1, FindPictureBox(mCurrentPageNumber))
' If mContinuousPages Then
' FindFlowLayoutPanel().ScrollControlIntoView(FindPictureBox(mCurrentPageNumber))
' ClearAllPictureBoxes(mCurrentPageNumber, mCurrentPageNumber)
' End If
'End Sub
Private Sub DisplayCurrentPage()
Dim oPict As PictureBox = FindPictureBox(mCurrentPageNumber)
If mLastPageNumber <> mCurrentPageNumber Then
CheckPageBounds()
UpdatePageLabel()
Dim newImage As Drawing.Image
If mUseXPDF Then
newImage = GetImageFromFile(mPDFFileName, mCurrentPageNumber - 1, AFPDFLibUtil.GetOptimalDPI(mPDFDoc, oPict))
Else
Dim optimalDPI As Integer = 0
If ImageUtil.IsPDF(mPDFFileName) Then
optimalDPI = iTextSharpUtil.GetOptimalDPI(mPDFFileName, mCurrentPageNumber, oPict, mPassword)
End If
newImage = GetImageFromFile(mPDFFileName, mCurrentPageNumber - 1, optimalDPI)
End If
If Not Nothing Is newImage Then
AutoRotatePicBox(oPict, newImage)
If ImageUtil.IsPDF(mPDFFileName) Then
MakePictureBox1To1WithImage(oPict, newImage)
End If
CenterPicBoxInPanel(oPict)
oPict.Image = newImage
End If
oPict.Refresh()
If mContinuousPages Then
FindFlowLayoutPanel().ScrollControlIntoView(oPict)
ClearAllPictureBoxes(mCurrentPageNumber, mCurrentPageNumber)
End If
Exit Sub
End If
AutoRotatePicBox(oPict, oPict.Image)
If ImageUtil.IsPDF(mPDFFileName) Then
MakePictureBox1To1WithImage(oPict, oPict.Image)
End If
CenterPicBoxInPanel(oPict)
End Sub
'Private Function GetCurrentScalePercentage() As Integer
' GetCurrentScalePercentage = 0
' Dim objPictureBox As PictureBox = FindPictureBox("SinglePicBox")
' If Not Nothing Is objPictureBox.Image Then
' Dim OriginalWidth As Integer = objPictureBox.Image.Width
' Dim CurrentWidth As Integer = objPictureBox.Width
' GetCurrentScalePercentage = CInt((CurrentWidth / OriginalWidth) * 100)
' End If
'End Function
Private Function FindPictureBox(ByVal controlName As String) As PictureBox
If mContinuousPages Then
FindPictureBox = FindControl(Panel1, controlName)
Else
FindPictureBox = FindControl(Panel1, "SinglePicBox")
End If
End Function
Public Function FindControl(ByVal container As Control, ByVal name As String) As Control
If container.Name = name Then
Return container
End If
For Each ctrl As Control In container.Controls
Dim foundCtrl As Control = FindControl(ctrl, name)
If foundCtrl IsNot Nothing Then
Return foundCtrl
End If
Next
Return Nothing
End Function
Private Sub ClearAllPictureBoxes(ByVal StartingPageNumber As Integer, ByVal EndingPageNumber As Integer)
Dim PagesToKeep As New List(Of String)
PagesToKeep.Add("0")
For i As Integer = StartingPageNumber To EndingPageNumber
PagesToKeep.Add(i.ToString)
Next
For Each oControl As Control In Panel1.Controls
For Each childControl As Control In oControl.Controls
If TypeOf childControl Is PictureBox And Not PagesToKeep.Contains(childControl.Name) Then
CType(childControl, PictureBox).Image = Nothing
End If
Next
Next
GC.Collect()
End Sub
Private Sub ApplyToAllPictureBoxes(ByRef oControl As Control, ByVal Mode As ViewMode)
Dim dummyPictureBox As New PictureBox
Dim optimalDPI As Integer = 0
If ImageUtil.IsPDF(mPDFFileName) Then
If mUseXPDF Then
optimalDPI = AFPDFLibUtil.GetOptimalDPI(mPDFDoc, dummyPictureBox)
End If
End If
dummyPictureBox.Image = GetImageFromFile(mPDFFileName, mCurrentPageNumber - 1, optimalDPI)
For Each childControl In oControl.Controls
If TypeOf childControl Is PictureBox Then
If Mode = ViewMode.FIT_TO_SCREEN Then
childControl.Height = childControl.Parent.ClientSize.Height - 14
childControl.Width = childControl.Parent.ClientSize.Width - 14
ElseIf Mode = ViewMode.FIT_WIDTH And Not Nothing Is dummyPictureBox.Image Then
childControl.Width = childControl.Parent.ClientSize.Width - 18
Dim ScaleAmount As Double = (childControl.Width / dummyPictureBox.Image.Width)
childControl.Height = CInt(dummyPictureBox.Image.Height * ScaleAmount)
ElseIf Mode = ViewMode.ACTUAL_SIZE And Not Nothing Is dummyPictureBox.Image Then
childControl.Width = dummyPictureBox.Image.Width
childControl.Height = dummyPictureBox.Image.Height
End If
End If
Next
GC.Collect()
End Sub
Private Function FindFlowLayoutPanel() As FlowLayoutPanel
FindFlowLayoutPanel = Nothing
For Each oControl In Panel1.Controls
If TypeOf oControl Is FlowLayoutPanel Then
Return oControl
End If
Next
End Function
Private Sub FitToScreen(Optional ByVal drawPage As Boolean = False)
If mContinuousPages Then
InitializePageView(ViewMode.FIT_TO_SCREEN)
DisplayCurrentPage()
Else
ApplyZoom(ViewMode.FIT_TO_SCREEN)
If drawPage Then
DisplayCurrentPage()
End If
End If
UpdatePageLabel()
End Sub
Private Function TrapKey(ByVal KCode As String) As Boolean
If (KCode >= 48 And KCode <= 57) Or KCode = 8 Then
TrapKey = False
Else
TrapKey = True
End If
End Function
#End Region
#Region "XPDF specific events"
Private Sub AFPDFLib_NodeMouseClick(ByVal sender As Object, ByVal e As TreeNodeMouseClickEventArgs)
Dim ol As OutlineItem = DirectCast(e.Node.Tag, OutlineItem)
If ol IsNot Nothing Then
Dim ret As Long = ol.DoAction()
Select Case ol.GetKind()
Case LinkActionKind.actionGoTo, LinkActionKind.actionGoToR
If Not mContinuousPages Then
ScrolltoTop(CInt(ret))
End If
Exit Select
Case LinkActionKind.actionLaunch
Exit Select
Case LinkActionKind.actionMovie
Exit Select
Case LinkActionKind.actionURI
Exit Select
End Select
mCurrentPageNumber = mPDFDoc.CurrentPage
DisplayCurrentPage()
End If
End Sub
Private Sub ScrolltoTop(ByVal y As Integer)
Dim dr As Point = Panel1.AutoScrollPosition
If mPDFDoc.PageHeight > Panel1.Height Then
dr.Y = y '* (GetCurrentScalePercentage() / 100)
End If
Panel1.AutoScrollPosition = dr
End Sub
Private Sub btSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btSearch.Click
Dim res As Integer = 0
Dim searchArgs As New SearchArgs(tbSearchText.Text, True, False, True, False, False)
res = SearchCallBack(sender, searchArgs)
End Sub
Private Sub btNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btNext.Click
Dim res As Integer = 0
res = SearchCallBack(sender, New SearchArgs(tbSearchText.Text, FromBeginning, False, True, True, False))
FromBeginning = False
If res = 0 Then
If MessageBox.Show("No results were found. Would you like to start from the beginning?", Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then
FromBeginning = True
btNext_Click(Nothing, Nothing)
End If
End If
End Sub
Private Function SearchCallBack(ByVal sender As Object, ByVal e As SearchArgs) As Integer
Cursor.Current = Cursors.WaitCursor
Dim lFound As Integer = 0
If mPDFDoc IsNot Nothing Then
mPDFDoc.SearchCaseSensitive = e.Exact
If e.FromBegin Then
lFound = mPDFDoc.FindFirst(e.Text, If(e.WholeDoc, PDFLibNet.PDFSearchOrder.PDFSearchFromdBegin, PDFLibNet.PDFSearchOrder.PDFSearchFromCurrent), e.Up, False)
ElseIf e.FindNext Then
If e.Up Then
lFound = mPDFDoc.FindPrevious(e.Text)
Else
lFound = mPDFDoc.FindNext(e.Text)
End If
Else
lFound = mPDFDoc.FindText(e.Text, mPDFDoc.CurrentPage, (If(e.WholeDoc, PDFLibNet.PDFSearchOrder.PDFSearchFromdBegin, PDFLibNet.PDFSearchOrder.PDFSearchFromCurrent)), e.Exact, e.Up, True, _
e.WholeDoc)
End If
If lFound > 0 Then
mPDFDoc.CurrentPage = mPDFDoc.SearchResults(0).Page
mCurrentPageNumber = mPDFDoc.CurrentPage
DisplayCurrentPage()
If Not mContinuousPages Then
FocusSearchResult(mPDFDoc.SearchResults(0))
End If
End If
End If
Return lFound
Cursor.Current = Cursors.Default
End Function
Private Sub FocusSearchResult(ByVal res As PDFLibNet.PDFSearchResult)
Dim objPanel As Panel = Panel1
Dim objPictureBox As PictureBox = FindPictureBox("SinglePicBox")
Dim dr As Point = objPanel.AutoScrollPosition
Dim XPercentage As Single = objPictureBox.Width / mPDFDoc.PageWidth
Dim YPercentage As Single = objPictureBox.Height / mPDFDoc.PageHeight
Dim WidthOffset As Integer = (objPanel.HorizontalScroll.Maximum - (mPDFDoc.PageWidth * YPercentage)) / 2
Dim HeightOffset As Integer = (objPanel.VerticalScroll.Maximum - objPictureBox.Height) / 2
If (mPDFDoc.PageWidth * XPercentage) > objPanel.Width Then
dr.X = (res.Position.Left * YPercentage)
If WidthOffset > 1 Then
dr.X += WidthOffset
End If
End If
If (mPDFDoc.PageHeight * YPercentage) > objPanel.Height Then
dr.Y = res.Position.Top * YPercentage
If HeightOffset > 1 Then
dr.Y += HeightOffset
End If
End If
objPanel.AutoScrollPosition = dr
End Sub
#End Region
#Region "ITextSharp specific events"
Private Sub ItextSharp_NodeMouseClick(ByVal sender As Object, ByVal e As TreeNodeMouseClickEventArgs)
Dim item As iTextOutline = CType(e.Node.Tag, iTextOutline)
If item.Page <> "" Then
mCurrentPageNumber = Regex.Replace(item.Page, "(^\d+).+$", "$1")
DisplayCurrentPage()
End If
End Sub
#End Region
#Region "Panning the image with left mouse click held down"
Private Sub picImage_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
'Capture the initial point
Cursor = Cursors.Hand
m_PanStartPoint = New Point(e.X, e.Y)
End Sub
Private Sub picImage_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
'Capture the initial point
Cursor = Cursors.Default
End Sub
Private Sub picImage_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
'Verify Left Button is pressed while the mouse is moving
If e.Button = Windows.Forms.MouseButtons.Left Then
'Here we get the change in coordinates.
Dim DeltaX As Integer = (m_PanStartPoint.X - e.X)
Dim DeltaY As Integer = (m_PanStartPoint.Y - e.Y)
'Then we set the new autoscroll position.
'ALWAYS pass positive integers to the panels autoScrollPosition method
sender.Parent.AutoScrollPosition = New Drawing.Point((DeltaX - sender.Parent.AutoScrollPosition.X), (DeltaY - sender.Parent.AutoScrollPosition.Y))
End If
End Sub
'Private Sub MouseWheel(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseWheel
' Dim iClicks As Integer = e.Delta
' If iClicks > 0 Then
' ImageUtil.PictureBoxZoomOut(PictureBox1)
' Else
' ImageUtil.PictureBoxZoomIn(PictureBox1)
' End If
' ShowCurrentScalePercentage()
'End Sub
#End Region
End Class

View File

@@ -0,0 +1,133 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<Global.System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1726")> _
Partial Class Password
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
Friend WithEvents LogoPictureBox As System.Windows.Forms.PictureBox
Friend WithEvents UsernameLabel As System.Windows.Forms.Label
Friend WithEvents UsernameTextBox As System.Windows.Forms.TextBox
Friend WithEvents OK As System.Windows.Forms.Button
Friend WithEvents Cancel As System.Windows.Forms.Button
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Password))
Me.LogoPictureBox = New System.Windows.Forms.PictureBox
Me.UsernameLabel = New System.Windows.Forms.Label
Me.UsernameTextBox = New System.Windows.Forms.TextBox
Me.OK = New System.Windows.Forms.Button
Me.Cancel = New System.Windows.Forms.Button
Me.OwnerTextBox = New System.Windows.Forms.TextBox
Me.Label1 = New System.Windows.Forms.Label
CType(Me.LogoPictureBox, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'LogoPictureBox
'
Me.LogoPictureBox.Image = CType(resources.GetObject("LogoPictureBox.Image"), System.Drawing.Image)
Me.LogoPictureBox.Location = New System.Drawing.Point(0, 3)
Me.LogoPictureBox.Name = "LogoPictureBox"
Me.LogoPictureBox.Size = New System.Drawing.Size(165, 144)
Me.LogoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom
Me.LogoPictureBox.TabIndex = 0
Me.LogoPictureBox.TabStop = False
'
'UsernameLabel
'
Me.UsernameLabel.Location = New System.Drawing.Point(171, 9)
Me.UsernameLabel.Name = "UsernameLabel"
Me.UsernameLabel.Size = New System.Drawing.Size(220, 23)
Me.UsernameLabel.TabIndex = 0
Me.UsernameLabel.Text = "User Password"
Me.UsernameLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'UsernameTextBox
'
Me.UsernameTextBox.Location = New System.Drawing.Point(171, 35)
Me.UsernameTextBox.Name = "UsernameTextBox"
Me.UsernameTextBox.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42)
Me.UsernameTextBox.Size = New System.Drawing.Size(220, 20)
Me.UsernameTextBox.TabIndex = 1
'
'OK
'
Me.OK.DialogResult = System.Windows.Forms.DialogResult.OK
Me.OK.Location = New System.Drawing.Point(297, 113)
Me.OK.Name = "OK"
Me.OK.Size = New System.Drawing.Size(94, 23)
Me.OK.TabIndex = 4
Me.OK.Text = "&OK"
'
'Cancel
'
Me.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Cancel.Location = New System.Drawing.Point(197, 113)
Me.Cancel.Name = "Cancel"
Me.Cancel.Size = New System.Drawing.Size(94, 23)
Me.Cancel.TabIndex = 5
Me.Cancel.Text = "&Cancel"
'
'OwnerTextBox
'
Me.OwnerTextBox.Location = New System.Drawing.Point(171, 84)
Me.OwnerTextBox.Name = "OwnerTextBox"
Me.OwnerTextBox.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42)
Me.OwnerTextBox.Size = New System.Drawing.Size(220, 20)
Me.OwnerTextBox.TabIndex = 7
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(171, 58)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(220, 23)
Me.Label1.TabIndex = 6
Me.Label1.Text = "Owner Password"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'Password
'
Me.AcceptButton = Me.OK
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.Cancel
Me.ClientSize = New System.Drawing.Size(401, 143)
Me.Controls.Add(Me.OwnerTextBox)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.Cancel)
Me.Controls.Add(Me.OK)
Me.Controls.Add(Me.UsernameTextBox)
Me.Controls.Add(Me.UsernameLabel)
Me.Controls.Add(Me.LogoPictureBox)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "Password"
Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "Please Enter the Password"
CType(Me.LogoPictureBox, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents OwnerTextBox As System.Windows.Forms.TextBox
Friend WithEvents Label1 As System.Windows.Forms.Label
End Class

View File

@@ -0,0 +1,528 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="LogoPictureBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAXepJREFUeF7tnQd4
FNXXxj/pnUAQKRYsWBAVhb+K2HvvHQWlCNKbha5gAbGgIIq9d5FiF+k91ABJ6L2XNJLQwvned3bu5u5k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/QCRGkssPt8AwACgoPYT9a+LRYOO9DMZAERxS+dIv2zz/Njb3PNwv1MDAAMA
cw38h68B8+X/h7/8wx09zOuj36MwADAAMNfAf/ga+H+S62CUUQxsUwAAAABJRU5ErkJggg==
</value>
</data>
</root>

View File

@@ -0,0 +1,22 @@
Public Class Password
Public UserPassword As String = ""
Public OwnerPassword As String = ""
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
Me.Close()
End Sub
Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
Me.Close()
End Sub
Private Sub UsernameTextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles UsernameTextBox.TextChanged
UserPassword = UsernameTextBox.Text
End Sub
Private Sub OwnerTextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles OwnerTextBox.TextChanged
OwnerPassword = OwnerTextBox.Text
End Sub
End Class

View File

@@ -0,0 +1,435 @@
Imports System.Drawing.Printing
Imports System.Runtime.InteropServices
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Imports System.IO
Public Class PrinterUtil
Private WithEvents mPrintDocument As PrintDocument
Private mFileName As String
Private mStartPage As Integer
Private mEndPage As Integer
Private mCurrentPage As Integer
Private mPassword As String
Public Shared Function ListAllInstalledPrinters() As List(Of String)
ListAllInstalledPrinters = New List(Of String)
For Each InstalledPrinter As String In _
PrinterSettings.InstalledPrinters
ListAllInstalledPrinters.Add(InstalledPrinter)
Next InstalledPrinter
End Function
Public Shared Function CreateCustomPrintToFilePort() As String
Dim TempString As String = Format(Now, "yyyyMMDDhhmmssfff")
Dim p1 As PrinterInterOp.PORT_INFO_1
p1.pPortName = System.IO.Path.GetTempPath & "\" & TempString & ".prn"
CreateCustomPrintToFilePort = p1.pPortName
PrinterInterOp.AddPortEx(Nothing, 1, p1, "Local Port")
End Function
Public Shared Function CreateNewTempPrinter(ByVal PrinterName As String, ByVal PortName As String, ByVal PrintDriverName As String) As Integer
Dim PrintInterop As New PrinterInterOp
CreateNewTempPrinter = PrintInterop.AddPrinter(PrinterName, PortName, PrintDriverName, "WinPrint")
End Function
Public Shared Sub SendFileToPrinter(ByVal PrinterName As String, ByVal FileName As String)
Dim RP As New RawPrinterHelper
RP.SendFileToPrinter(PrinterName, FileName)
End Sub
Public Shared Sub PrintImageToPrinter(ByRef myFileName As String, ByVal myPrinterSettings As PrinterSettings, Optional ByVal password As String = "")
Dim PrintUtil As New PrinterUtil
PrintUtil.mPrintDocument = New PrintDocument
PrintUtil.mFileName = myFileName
PrintUtil.mPrintDocument.PrinterSettings.PrinterName = myPrinterSettings.PrinterName
Dim StandardPrint As New StandardPrintController
PrintUtil.mPrintDocument.PrintController = StandardPrint
PrintUtil.mPrintDocument.PrinterSettings = myPrinterSettings
PrintUtil.mStartPage = myPrinterSettings.FromPage
PrintUtil.mEndPage = myPrinterSettings.ToPage
PrintUtil.mCurrentPage = PrintUtil.mStartPage
PrintUtil.mPassword = password
Cursor.Current = Cursors.WaitCursor
PrintUtil.mPrintDocument.Print()
PrintUtil = Nothing
GC.Collect()
Cursor.Current = Cursors.Default
End Sub
Public Shared Sub PrintPDFDirectlyToPrinter(ByVal FileName As String)
Dim PD As New PrintDialog
If PD.ShowDialog = DialogResult.OK Then
Dim RP As New RawPrinterHelper
RP.SendFileToPrinter(PD.PrinterSettings.PrinterName, FileName)
End If
End Sub
Public Shared Sub PrintImagesToPrinter(ByVal FileName As String, Optional ByVal password As String = "")
Dim PD As New PrintDialog
Dim PageCount As Integer = PDFView.ImageUtil.GetImageFrameCount(FileName)
PD.AllowPrintToFile = True
PD.AllowSomePages = True
PD.PrinterSettings.FromPage = 1
PD.PrinterSettings.ToPage = PageCount
PD.PrinterSettings.MaximumPage = PageCount
PD.PrinterSettings.MinimumPage = 1
If PD.ShowDialog = DialogResult.OK Then
Dim BeginningPage As Integer = 1
Dim EndingPage As Integer = PageCount
If PD.PrinterSettings.PrintRange = PrintRange.SomePages Then
BeginningPage = PD.PrinterSettings.FromPage
EndingPage = PD.PrinterSettings.ToPage
End If
PrintImageToPrinter(FileName, PD.PrinterSettings, password)
End If
End Sub
Private Sub PrintDocument1_PrintPage(ByVal sender As Object, _
ByVal e As PrintPageEventArgs) Handles mPrintDocument.PrintPage
Dim RenderDPI As Integer = 300 'Set to 600 if this resolution is too low (speed vs. time)
Dim image As System.Drawing.Image = ImageUtil.GetImagePageFromFileForPrint(mFileName, mCurrentPage, RenderDPI, mPassword)
'Comment out if you do not want Auto-Rotate
If (image.Height > image.Width And e.Graphics.VisibleClipBounds.Width > e.Graphics.VisibleClipBounds.Height) _
Or (image.Width > image.Height And e.Graphics.VisibleClipBounds.Height > e.Graphics.VisibleClipBounds.Width) Then
image.RotateFlip(RotateFlipType.Rotate270FlipNone)
End If
Dim ScalePercentage As Single
Dim XMaxPixels As Integer = (e.Graphics.VisibleClipBounds.Width / 100) * image.HorizontalResolution
Dim YMaxPixels As Integer = (e.Graphics.VisibleClipBounds.Height / 100) * image.VerticalResolution
Dim XFactor As Single = XMaxPixels / image.Width
Dim YFactor As Single = YMaxPixels / image.Height
Dim OptimalDPI As Integer
If YFactor > XFactor Then
ScalePercentage = XFactor
OptimalDPI = RenderDPI * XFactor
Else
ScalePercentage = YFactor
OptimalDPI = RenderDPI * YFactor
End If
If ScalePercentage < 0.75F Then 'Re-render the image to create a smaller print file and save printer processing time
image = ImageUtil.GetImagePageFromFileForPrint(mFileName, mCurrentPage, OptimalDPI, mPassword)
If (image.Height > image.Width And e.Graphics.VisibleClipBounds.Width > e.Graphics.VisibleClipBounds.Height) _
Or (image.Width > image.Height And e.Graphics.VisibleClipBounds.Height > e.Graphics.VisibleClipBounds.Width) Then
image.RotateFlip(RotateFlipType.Rotate270FlipNone)
End If
End If
e.Graphics.ScaleTransform(ScalePercentage, ScalePercentage)
e.Graphics.DrawImage(image, 0, 0)
If mCurrentPage >= mEndPage Then
e.HasMorePages = False
Else
e.HasMorePages = True
End If
image.Dispose()
mCurrentPage += 1
End Sub
End Class
Friend Class PrinterInterOp
Public Structure PORT_INFO_1
Dim pPortName As String
End Structure
Structure PrinterDefaults
Public pDataType As String
Public pDevMode As Int32
Public permissions As Int32
End Structure
Public Function AddPrinter(ByVal psPrinterName As String, ByVal psPortName As String, _
ByVal psDriverName As String, _
ByVal psPrintProcessor As String) As IntPtr
Dim pi2 As New PRINTER_INFO_2
Dim iError As Integer
With pi2
.pPrinterName = psPrinterName
.pPortName = psPortName
.pDriverName = psDriverName
.pPrintProcessor = psPrintProcessor
End With
Dim rtn As Int32
rtn = AddPrinter("", 2, pi2)
If rtn = 0 Then
iError = Marshal.GetLastWin32Error()
Select Case iError
Case 1796
MsgBox("The specified port is unknown")
Exit Select
Case 1797
MsgBox("Printer driver is unknown or not loaded")
Exit Select
Case 1798
MsgBox("The print processor is unknown")
Exit Select
Case 1801
MsgBox("Printer name is invalid")
Exit Select
Case 1802
MsgBox("Printer name already exists")
Exit Select
Case Else
MsgBox("An error occured. Errorcode: " & iError)
Exit Select
End Select
Else
MsgBox("Printer was created successfully")
End If
ClosePrinter(rtn)
Return rtn
End Function
Public Sub RemovePrinter(ByVal PrinterName As String)
Dim hPrinter As IntPtr
Dim PrinterDefs As New PrinterDefaults
With PrinterDefs
.pDevMode = 0&
.permissions = PRINTER_ALL_ACCESS
End With
If OpenPrinter(PrinterName, hPrinter, PrinterDefs) <> 0 Then
If hPrinter <> 0 Then
If DeletePrinter(hPrinter) <> 0 Then
MsgBox("Printer deleted")
Else
MsgBox("Error :" & Err.LastDllError)
End If 'DeletePrinter
End If 'hPrinter
ClosePrinter(hPrinter)
Else
MsgBox("Error :" & Err.LastDllError)
End If 'OpenPrinter
End Sub
Public Declare Function AddPortEx Lib "winspool.drv" Alias "AddPortExA" _
(ByVal pName As String, ByVal pLevel As Integer, _
ByRef lpBuffer As PORT_INFO_1, ByVal pMonitorName As String) As Integer
Public Declare Function DeletePort Lib "winspool.drv" _
(ByVal pName As String, ByVal pLevel As Integer, _
ByVal pMonitorName As String) As Integer
Public Declare Auto Function OpenPrinter Lib "winspool.drv" _
(ByVal pPrinterName As String, _
ByRef phPrinter As IntPtr, _
ByVal pDefault As PrinterDefaults) As Int32
Public Declare Auto Function ResetPrinter Lib "winspool.drv" _
(ByRef phPrinter As IntPtr, _
ByVal pDefault As PrinterDefaults) As Int32
Public Declare Function DeletePrinter Lib "winspool.drv" _
(ByVal hPrinter As IntPtr) As Int32
Public Declare Function ClosePrinter Lib "winspool.drv" _
(ByVal hPrinter As IntPtr) As Int32
Private Declare Function AddPrinter Lib "winspool.drv" _
Alias "AddPrinterA" _
(ByVal pServerName As String, _
ByVal Level As Int32, _
ByVal pPrinter As PRINTER_INFO_2) As Int32
Public Declare Function GetPrinter Lib "winspool.drv" Alias "GetPrinterW" _
(ByVal hPrinter As IntPtr, ByVal Level As Integer, ByVal pPrinter As IntPtr, _
ByVal cbBuf As Integer, ByRef pcbNeeded As Integer) As Integer
Public Const PRINTER_ACCESS_ADMINISTER As Int32 = &H4
Public Const STANDARD_RIGHTS_REQUIRED As Int32 = &HF0000
Public Const PRINTER_ACCESS_USE As Int32 = &H8
Public Const PRINTER_ALL_ACCESS As Int32 = _
STANDARD_RIGHTS_REQUIRED Or _
PRINTER_ACCESS_USE Or _
PRINTER_ACCESS_ADMINISTER
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto), System.Security.SuppressUnmanagedCodeSecurity()> _
Friend Class PRINTER_INFO_2
<MarshalAs(UnmanagedType.LPStr)> Public pServerName As String
<MarshalAs(UnmanagedType.LPStr)> Public pPrinterName As String
<MarshalAs(UnmanagedType.LPStr)> Public pShareName As String
<MarshalAs(UnmanagedType.LPStr)> Public pPortName As String
<MarshalAs(UnmanagedType.LPStr)> Public pDriverName As String
<MarshalAs(UnmanagedType.LPStr)> Public pComment As String
<MarshalAs(UnmanagedType.LPStr)> Public pLocation As String
<MarshalAs(UnmanagedType.U4)> Public pDevMode As Int32
<MarshalAs(UnmanagedType.LPStr)> Public pSepFile As String
<MarshalAs(UnmanagedType.LPStr)> Public pPrintProcessor As String
<MarshalAs(UnmanagedType.LPStr)> Public pDatatype As String
<MarshalAs(UnmanagedType.LPStr)> Public pParameters As String
<MarshalAs(UnmanagedType.U4)> Public pSecurityDescriptor As Int32
Public Attributes As UInteger
Public Priority As UInteger
Public DefaultPriority As UInteger
Public StartTime As UInteger
Public UntilTime As UInteger
Public Status As UInteger
Public cJobs As UInteger
Public AveragePPM As UInteger
Public Sub New(ByVal hPrinter As IntPtr)
Dim BytesWritten As Int32 = 0
Dim ptBuf As IntPtr
ptBuf = Marshal.AllocHGlobal(1)
Dim PI As New PrinterInterOp
If Not GetPrinter(hPrinter, 2, ptBuf, 1, BytesWritten) Then
If BytesWritten > 0 Then
'\\ Free the buffer allocated
Marshal.FreeHGlobal(ptBuf)
ptBuf = Marshal.AllocHGlobal(BytesWritten)
If GetPrinter(hPrinter, 2, ptBuf, BytesWritten, BytesWritten) Then
Marshal.PtrToStructure(ptBuf, Me)
'\\ Fill any missing members
If pServerName Is Nothing Then
pServerName = ""
End If
Else
Throw New Win32Exception()
End If
'\\ Free this buffer again
Marshal.FreeHGlobal(ptBuf)
Else
Throw New Win32Exception()
End If
Else
Throw New Win32Exception()
End If
End Sub
Public Sub New()
End Sub
End Class
End Class
Friend Class RawPrinterHelper
' Structure and API declarions:
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> _
Public Class DOCINFOA
<MarshalAs(UnmanagedType.LPStr)> _
Public pDocName As String
<MarshalAs(UnmanagedType.LPStr)> _
Public pOutputFile As String
<MarshalAs(UnmanagedType.LPStr)> _
Public pDataType As String
End Class
<DllImport("winspool.Drv", EntryPoint:="OpenPrinterA", SetLastError:=True, CharSet:=CharSet.Ansi, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function OpenPrinter(<MarshalAs(UnmanagedType.LPStr)> ByVal szPrinter As String, ByRef hPrinter As IntPtr, ByVal pd As IntPtr) As Boolean
End Function
<DllImport("winspool.Drv", EntryPoint:="ClosePrinter", SetLastError:=True, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function ClosePrinter(ByVal hPrinter As IntPtr) As Boolean
End Function
<DllImport("winspool.Drv", EntryPoint:="StartDocPrinterA", SetLastError:=True, CharSet:=CharSet.Ansi, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function StartDocPrinter(ByVal hPrinter As IntPtr, ByVal level As Int32, <[In](), MarshalAs(UnmanagedType.LPStruct)> ByVal di As DOCINFOA) As Boolean
End Function
<DllImport("winspool.Drv", EntryPoint:="EndDocPrinter", SetLastError:=True, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function EndDocPrinter(ByVal hPrinter As IntPtr) As Boolean
End Function
<DllImport("winspool.Drv", EntryPoint:="StartPagePrinter", SetLastError:=True, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function StartPagePrinter(ByVal hPrinter As IntPtr) As Boolean
End Function
<DllImport("winspool.Drv", EntryPoint:="EndPagePrinter", SetLastError:=True, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function EndPagePrinter(ByVal hPrinter As IntPtr) As Boolean
End Function
<DllImport("winspool.Drv", EntryPoint:="WritePrinter", SetLastError:=True, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function WritePrinter(ByVal hPrinter As IntPtr, ByVal pBytes As IntPtr, ByVal dwCount As Int32, ByRef dwWritten As Int32) As Boolean
End Function
' SendBytesToPrinter()
' When the function is given a printer name and an unmanaged array
' of bytes, the function sends those bytes to the print queue.
' Returns true on success, false on failure.
Public Function SendBytesToPrinter(ByVal szPrinterName As String, ByVal pBytes As IntPtr, ByVal dwCount As Int32) As Boolean
Dim dwError As Int32 = 0, dwWritten As Int32 = 0
Dim hPrinter As New IntPtr(0)
Dim di As New DOCINFOA()
Dim bSuccess As Boolean = False
' Assume failure unless you specifically succeed.
di.pDocName = "My VB.NET RAW Document"
di.pDataType = "RAW"
' Open the printer.
If OpenPrinter(szPrinterName.Normalize(), hPrinter, IntPtr.Zero) Then
' Start a document.
If StartDocPrinter(hPrinter, 1, di) Then
' Start a page.
If StartPagePrinter(hPrinter) Then
' Write your bytes.
bSuccess = WritePrinter(hPrinter, pBytes, dwCount, dwWritten)
EndPagePrinter(hPrinter)
End If
EndDocPrinter(hPrinter)
End If
ClosePrinter(hPrinter)
End If
' If you did not succeed, GetLastError may give more information
' about why not.
If bSuccess = False Then
dwError = Marshal.GetLastWin32Error()
End If
Return bSuccess
End Function
Public Function SendFileToPrinter(ByVal szPrinterName As String, ByVal szFileName As String) As Boolean
' Open the file.
Dim fs As New FileStream(szFileName, FileMode.Open)
' Create a BinaryReader on the file.
Dim br As New BinaryReader(fs)
' Dim an array of bytes big enough to hold the file's contents.
Dim bytes As [Byte]() = New [Byte](fs.Length - 1) {}
Dim bSuccess As Boolean = False
' Your unmanaged pointer.
Dim pUnmanagedBytes As New IntPtr(0)
Dim nLength As Integer
nLength = Convert.ToInt32(fs.Length)
' Read the contents of the file into the array.
bytes = br.ReadBytes(nLength)
' Allocate some unmanaged memory for those bytes.
pUnmanagedBytes = Marshal.AllocCoTaskMem(nLength)
' Copy the managed byte array into the unmanaged array.
Marshal.Copy(bytes, 0, pUnmanagedBytes, nLength)
' Send the unmanaged bytes to the printer.
bSuccess = SendBytesToPrinter(szPrinterName, pUnmanagedBytes, nLength)
' Free the unmanaged memory that you allocated earlier.
Marshal.FreeCoTaskMem(pUnmanagedBytes)
fs.Close()
br.Close()
Return bSuccess
End Function
Public Function SendStringToPrinter(ByVal szPrinterName As String, ByVal szString As String) As Boolean
Dim pBytes As IntPtr
Dim dwCount As Int32
' How many characters are in the string?
dwCount = szString.Length
' Assume that the printer is expecting ANSI text, and then convert
' the string to ANSI text.
pBytes = Marshal.StringToCoTaskMemAnsi(szString)
' Send the converted ANSI string to the printer.
SendBytesToPrinter(szPrinterName, pBytes, dwCount)
Marshal.FreeCoTaskMem(pBytes)
Return True
End Function
End Class

View File

@@ -0,0 +1,81 @@
Imports System.Drawing
Imports System.Windows.Forms
Public Class TesseractOCR
Public Shared Function OCRImage(ByVal bm As System.Drawing.Image, ByVal language As String) As String
OCRImage = ""
Dim oOCR As New tessnet2.Tesseract
oOCR.Init(Nothing, language, False)
Dim WordList As New List(Of tessnet2.Word)
WordList = oOCR.doOCR(ImageUtil.MakeGrayscale(bm), Rectangle.Empty)
Dim LineCount As Integer = tessnet2.Tesseract.LineCount(WordList)
For i As Integer = 0 To LineCount - 1
OCRImage &= tessnet2.Tesseract.GetLineText(WordList, i) & vbCrLf
Next
oOCR.Dispose()
''Debug
'OCRPaintWordBorders(bm, WordList)
End Function
Public Shared Sub OCRPaintWordBorders(ByRef img As System.Drawing.Image, ByVal WordList As List(Of tessnet2.Word))
If WordList IsNot Nothing Then
Dim g As Graphics = Graphics.FromImage(img)
g.DrawImage(img, 0, 0)
For Each word As tessnet2.Word In WordList
Dim pen As Pen = New Pen(Color.FromArgb(255, 128, CInt(word.Confidence)))
g.DrawRectangle(pen, word.Left, word.Top, word.Right - word.Left, word.Bottom - word.Top)
'For Each c As tessnet2.Character In word.CharList
' e.Graphics.DrawRectangle(Pens.BlueViolet, c.Left + panel2.AutoScrollPosition.X, c.Top + panel2.AutoScrollPosition.Y, c.Right - c.Left, c.Bottom - c.Top)
'Next
Next
g.Dispose()
End If
End Sub
Public Shared Function GetPDFIndex(ByRef imgOCR As System.Drawing.Image, ByVal language As String) As List(Of PDFWordIndex)
GetPDFIndex = New List(Of PDFWordIndex)
Dim oOCR As New tessnet2.Tesseract
oOCR.Init(Nothing, language, False)
Dim WordList As New List(Of tessnet2.Word)
WordList = oOCR.doOCR(imgOCR, Rectangle.Empty)
If WordList IsNot Nothing Then
For Each word As tessnet2.Word In WordList
Dim pdfWordIndex As New PDFWordIndex
pdfWordIndex.X = word.Left
pdfWordIndex.Y = word.Top
pdfWordIndex.Width = word.Right - word.Left
pdfWordIndex.Height = word.Bottom - word.Top
pdfWordIndex.FontSize = word.PointSize
pdfWordIndex.Text = word.Text
GetPDFIndex.Add(pdfWordIndex)
Next
End If
End Function
Public Structure Language
Dim i As Integer
Shared English As String = "eng"
Shared Spanish As String = "spa"
Shared German As String = "deu"
Shared Italian As String = "ita"
Shared French As String = "fra"
Shared Dutch As String = "nld"
Shared Portuguese As String = "por"
Shared Vietnamese As String = "vie"
Shared Basque As String = "eus"
Shared Fraktur As String = "deu-f"
End Structure
End Class
Public Class PDFWordIndex
Public X As Integer
Public Y As Integer
Public Width As Integer
Public Height As Integer
Public FontSize As Integer
Public Text As String
End Class

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,298 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>
PDFView
</name>
</assembly>
<members>
<member name="T:PDFView.ConvertPDF.PDFConvert">
<summary>
Create by : TaGoH
URL of the last version: http://www.codeproject.com/KB/cs/GhostScriptUseWithCSharp.aspx
Description:
Class to convert a pdf to an image using GhostScript DLL
A big Credit for this code go to:Rangel Avulso
I mainly create a better interface and refactor it to made it ready to use!
</summary>
</member>
<member name="F:PDFView.ConvertPDF.PDFConvert.useSimpleAnsiConversion">
<summary>Use to check for default transformation</summary>
</member>
<member name="F:PDFView.ConvertPDF.PDFConvert.GS_OutputFileFormat">
<summary>Thanks to tchu_2000 to remind that u should never hardcode strings! :)</summary>
</member>
<member name="M:PDFView.ConvertPDF.PDFConvert.CopyMemory(System.IntPtr,System.IntPtr,System.UInt32)">
<summary>Needed to copy memory from one location to another, used to fill the struct</summary>
<param name="Destination"></param>
<param name="Source"></param>
<param name="Length"></param>
</member>
<member name="M:PDFView.ConvertPDF.PDFConvert.gsapi_new_instance(System.IntPtr@,System.IntPtr)">
<summary>Create a new instance of Ghostscript. This instance is passed to most other gsapi functions. The caller_handle will be provided to callback functions.
At this stage, Ghostscript supports only one instance. </summary>
<param name="pinstance"></param>
<param name="caller_handle"></param>
<returns></returns>
</member>
<member name="M:PDFView.ConvertPDF.PDFConvert.gsapi_init_with_args(System.IntPtr,System.Int32,System.IntPtr)">
<summary>This is the important function that will perform the conversion</summary>
<param name="instance"></param>
<param name="argc"></param>
<param name="argv"></param>
<returns></returns>
</member>
<member name="M:PDFView.ConvertPDF.PDFConvert.gsapi_exit(System.IntPtr)">
<summary>
Exit the interpreter. This must be called on shutdown if gsapi_init_with_args() has been called, and just before gsapi_delete_instance().
</summary>
<param name="instance"></param>
<returns></returns>
</member>
<member name="M:PDFView.ConvertPDF.PDFConvert.gsapi_delete_instance(System.IntPtr)">
<summary>
Destroy an instance of Ghostscript. Before you call this, Ghostscript must have finished. If Ghostscript has been initialised, you must call gsapi_exit before gsapi_delete_instance.
</summary>
<param name="instance"></param>
</member>
<member name="M:PDFView.ConvertPDF.PDFConvert.gsapi_revision(PDFView.ConvertPDF.GS_Revision@,System.Int32)">
<summary>Get info about the version of Ghostscript i'm using</summary>
<param name="pGSRevisionInfo"></param>
<param name="intLen"></param>
<returns></returns>
</member>
<member name="M:PDFView.ConvertPDF.PDFConvert.gsapi_set_stdio(System.IntPtr,PDFView.ConvertPDF.StdioCallBack,PDFView.ConvertPDF.StdioCallBack,PDFView.ConvertPDF.StdioCallBack)">
<summary>Use a different I/O</summary>
<param name="lngGSInstance"></param>
<param name="gsdll_stdin">Function that menage the Standard INPUT</param>
<param name="gsdll_stdout">Function that menage the Standard OUTPUT</param>
<param name="gsdll_stderr">Function that menage the Standard ERROR output</param>
<returns></returns>
</member>
<member name="F:PDFView.ConvertPDF.PDFConvert._iFirstPageToConvert">
<summary>The first page to convert in image</summary>
</member>
<member name="F:PDFView.ConvertPDF.PDFConvert._iLastPageToConvert">
<summary>The last page to conver in an image</summary>
</member>
<member name="F:PDFView.ConvertPDF.PDFConvert._iGraphicsAlphaBit">
<summary>This parameter is used to control subsample antialiasing of graphics</summary>
</member>
<member name="F:PDFView.ConvertPDF.PDFConvert._iTextAlphaBit">
<summary>This parameter is used to control subsample antialiasing of text</summary>
</member>
<member name="F:PDFView.ConvertPDF.PDFConvert._iRenderingThreads">
<summary>In how many thread i should perform the conversion</summary>
<remarks>This is a Major innovation since 8.63 NEVER use it with previous version!</remarks>
</member>
<member name="P:PDFView.ConvertPDF.PDFConvert.RenderingThreads">
<summary>In how many thread i should perform the conversion</summary>
<remarks>This is a Major innovation since 8.63 NEVER use it with previous version!</remarks>
<value>Set it to 0 made the program set it to Environment.ProcessorCount HT machine could want to perform a check for this..</value>
</member>
<member name="F:PDFView.ConvertPDF.PDFConvert._sDefaultPageSize">
<summary>The pagesize of the output</summary>
</member>
<member name="F:PDFView.ConvertPDF.PDFConvert._didOutputToMultipleFile">
<summary>If true i will try to output everypage to a different file!</summary>
</member>
<member name="P:PDFView.ConvertPDF.PDFConvert.OutputFormat">
<summary>
What format to use to convert
is suggested to use png256 instead of jpeg for document!
they are smaller and better suited!
</summary>
</member>
<member name="P:PDFView.ConvertPDF.PDFConvert.DefaultPageSize">
<summary>The pagesize of the output</summary>
<remarks>Without this parameter the output should be letter, complain to USA for this :) if the document specify a different size it will take precedece over this!</remarks>
</member>
<member name="P:PDFView.ConvertPDF.PDFConvert.ForcePageSize">
<summary>If set to true and page default page size will force the rendering in that output format</summary>
</member>
<member name="P:PDFView.ConvertPDF.PDFConvert.GraphicsAlphaBit">
<summary>This parameter is used to control subsample antialiasing of graphics</summary>
<value>Value MUST BE below or equal 0 if not set, or 1,2,or 4 NO OTHER VALUES!</value>
</member>
<member name="P:PDFView.ConvertPDF.PDFConvert.TextAlphaBit">
<summary>This parameter is used to control subsample antialiasing of text</summary>
<value>Value MUST BE below or equal 0 if not set, or 1,2,or 4 NO OTHER VALUES!</value>
</member>
<member name="P:PDFView.ConvertPDF.PDFConvert.JPEGQuality">
<summary>Quality of compression of JPG</summary>
</member>
<member name="P:PDFView.ConvertPDF.PDFConvert.FirstPageToConvert">
<summary>The first page to convert in image</summary>
</member>
<member name="P:PDFView.ConvertPDF.PDFConvert.LastPageToConvert">
<summary>The last page to conver in an image</summary>
</member>
<member name="P:PDFView.ConvertPDF.PDFConvert.ThrowOnlyException">
<summary>Set to True if u want the program to never display Messagebox
but otherwise throw exception</summary>
</member>
<member name="P:PDFView.ConvertPDF.PDFConvert.RedirectIO">
<summary>If i should redirect the Output of Ghostscript library somewhere</summary>
</member>
<member name="P:PDFView.ConvertPDF.PDFConvert.OutputToMultipleFile">
<summary>If true i will try to output everypage to a different file!</summary>
</member>
<member name="M:PDFView.ConvertPDF.PDFConvert.Convert(System.String,System.String)">
<summary>Convert a single file!</summary>
<param name="inputFile">The file PDf to convert</param>
<param name="outputFile">The image file that will be created</param>
<remarks>You must pass all the parameter for the conversion
as Proprieties of this class</remarks>
<returns>True if the conversion succed!</returns>
</member>
<member name="M:PDFView.ConvertPDF.PDFConvert.Convert(System.String,System.String,System.String)">
<summary>Convert a single file!</summary>
<param name="inputFile">The file PDf to convert</param>
<param name="outputFile">The image file that will be created</param>
<param name="parameters">You must pass all the parameter for the conversion here</param>
<remarks>Thanks to tchu_2000 for the help!</remarks>
<returns>True if the conversion succed!</returns>
</member>
<member name="M:PDFView.ConvertPDF.PDFConvert.Convert(System.String,System.String,System.Boolean,System.String)">
<summary>Convert a single file!</summary>
<param name="inputFile">The file PDf to convert</param>
<param name="outputFile">The image file that will be created</param>
<param name="throwException">if the function should throw an exception
or display a message box</param>
<remarks>You must pass all the parameter for the conversion
as Proprieties of this class</remarks>
<returns>True if the conversion succed!</returns>
</member>
<member name="M:PDFView.ConvertPDF.PDFConvert.ClearParameters(System.Runtime.InteropServices.GCHandle[]@,System.Runtime.InteropServices.GCHandle@)">
<summary>Remove the memory allocated</summary>
<param name="aGCHandle"></param>
<param name="gchandleArgs"></param>
</member>
<member name="M:PDFView.ConvertPDF.PDFConvert.GetGeneratedArgs(System.String,System.String,System.String)">
<summary>This function create the list of parameters to pass to the dll with parameters given directly from the program</summary>
<param name="inputFile"></param>
<param name="outputFile"></param>
<param name="otherParameters">The other parameters i could be interested</param>
<remarks>Be very Cautious using this! code provided and modified from tchu_2000</remarks>
<returns></returns>
</member>
<member name="M:PDFView.ConvertPDF.PDFConvert.GetGeneratedArgs(System.String,System.String,System.String[])">
<summary>This function create the list of parameters to pass to the dll</summary>
<param name="inputFile">the file to convert</param>
<param name="outputFile">where to write the image</param>
<returns>the list of the arguments</returns>
</member>
<member name="M:PDFView.ConvertPDF.PDFConvert.StringToAnsiZ(System.String)">
<summary>
Convert a Unicode string to a null terminated Ansi string for Ghostscript.
The result is stored in a byte array
</summary>
<param name="str">The parameter i want to convert</param>
<returns>the byte array that contain the string</returns>
</member>
<member name="M:PDFView.ConvertPDF.PDFConvert.AnsiZtoString(System.IntPtr)">
<summary>Convert a Pointer to a string to a real string</summary>
<param name="strz">the pointer to the string in memory</param>
<returns>The string</returns>
</member>
<member name="T:PDFView.ConvertPDF.StdioCallBack">
<summary>Delegate used by Ghostscript to perform I/O operations</summary>
<param name="handle"></param>
<param name="strptr"></param>
<param name="count"></param>
<returns></returns>
</member>
<member name="T:PDFView.ConvertPDF.GS_Revision">
<summary>This struct is filled with the information of the version of this ghostscript</summary>
<remarks>Have the layout defined cuz i will fill it with a kernel copy memory</remarks>
</member>
<member name="T:PDFView.My.Resources.Resources">
<summary>
Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
</summary>
</member>
<member name="P:PDFView.My.Resources.Resources.ResourceManager">
<summary>
Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
</summary>
</member>
<member name="P:PDFView.My.Resources.Resources.Culture">
<summary>
Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
</summary>
</member>
<member name="P:PDFView.My.Resources.Resources.BookmarkHtml">
<summary>
Sucht eine lokalisierte Zeichenfolge, die &lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;PageIndex&lt;/TITLE&gt;
&lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&gt;
function changeImage(filename)
{
parent.pageviewer.document.images[&apos;mainimage&apos;].src = filename;
}
&lt;/script&gt;
&lt;/HEAD&gt;
&lt;BODY bgcolor=&quot;#DDDDDD&quot;&gt;{Body}&lt;/BODY&gt;
&lt;/HTML&gt; ähnelt.
</summary>
</member>
<member name="P:PDFView.My.Resources.Resources.FrameHtml">
<summary>
Sucht eine lokalisierte Zeichenfolge, die &lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;PDF to Image Html&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;FRAMESET ROWS=&quot;50,*&quot; FRAMEBORDER=0 BORDER=0 &gt;
&lt;FRAME NAME=&quot;top&quot; SRC=&quot;content/top.html&quot; MARGINHEIGHT=0 MARGINWIDTH=0 NORESIZE&gt;
&lt;FRAMESET COLS=&quot;20%,80%&quot; FRAMEBORDER=0 BORDER=0&gt;
&lt;FRAME NAME=&quot;left&quot; SRC=&quot;content/bookmark.html&quot; MARGINHEIGHT=0 MARGINWIDTH=0 SCROLLING=AUTO NORESIZE&gt;
&lt;FRAMESET ROWS=&quot;*,25&quot; FRAMEBORDER=0 BORDER=0 &gt;
&lt;FRAME NAME=&quot;pa [Rest der Zeichenfolge wurde abgeschnitten]&quot;; ähnelt.
</summary>
</member>
<member name="P:PDFView.My.Resources.Resources.PageHtml">
<summary>
Sucht eine lokalisierte Zeichenfolge, die &lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;PageViewer&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;BODY bgcolor=&quot;#999999&quot;&gt;&lt;center&gt;&lt;img id=&quot;mainimage&quot; src=&quot;images/page1.png&quot; width=&quot;100%&quot;&gt;&lt;/center&gt;&lt;/BODY&gt;
&lt;/HTML&gt; ähnelt.
</summary>
</member>
<member name="P:PDFView.My.Resources.Resources.PagesizeHtml">
<summary>
Sucht eine lokalisierte Zeichenfolge, die &lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;PageSize&lt;/TITLE&gt;
&lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&gt;
function fitScreen()
{
parent.pageviewer.document.images[&apos;mainimage&apos;].style.height = &apos;100%&apos;;
parent.pageviewer.document.images[&apos;mainimage&apos;].style.width = &apos;auto&apos;;
}
function fitWidth()
{
parent.pageviewer.document.images[&apos;mainimage&apos;].style.height = &apos;auto&apos;;
parent.pageviewer.document.images[&apos;mainimage&apos;].style.width = &apos;100%&apos;;
}
function fitActual()
{
parent.pageviewer.document.images[&apos;mainimage&apos;].style.height = &apos;auto&apos;;
parent [Rest der Zeichenfolge wurde abgeschnitten]&quot;; ähnelt.
</summary>
</member>
<member name="P:PDFView.My.Resources.Resources.TopHtml">
<summary>
Sucht eine lokalisierte Zeichenfolge, die &lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;DocumentName&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;BODY bgcolor=&quot;#BBBBBB&quot;&gt;{DocumentName}&lt;/BODY&gt;
&lt;/HTML&gt; ähnelt.
</summary>
</member>
</members>
</doc>

View File

@@ -0,0 +1,39 @@
1 m 2 r n
2 r n 1 m
1 m 2 i n
2 i n 1 m
1 d 2 c l
2 c l 1 d
2 n n 2 r m
2 r m 2 n n
1 n 2 r i
2 r i 1 n
2 l i 1 h
2 l r 1 h
2 i i 1 u
2 i i 1 n
2 n i 1 m
3 i i i 1 m
2 l l 1 H
3 I - I 1 H
2 v v 1 w
2 V V 1 W
1 t 1 f
1 f 1 t
1 a 1 o
1 o 1 a
1 e 1 c
1 c 1 e
2 r r 1 n
1 E 2 f i
2 l < 1 k
2 l d 2 k i
2 l x 1 h
2 x n 1 m
2 u x 2 i n
1 r 1 t
1 d 2 t l
2 d i 2 t h
2 u r 2 i n
2 u n 2 i m
1 u 1 a

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,111 @@
t 66
h 77
r 51
o 59
u 81
g 100
N 79
e 65
w 94
S 90
F 79
i 68
n 74
d 84
f 71
a 76
m 111
l 58
y 83
s 82
¢ 84
¥ 88
q 87
V 73
L 65
U 74
v 82
E 92
H 102
` 58
¤ 92
B 84
P 72
c 69
O 76
J 63
( 66
€ 99
1 68
, 58
0 73
. 51
) 63
“ 92
R 87
” 90
D 74
M 100
b 74
- 43
; 78
W 95
® 145
? 94
~ 73
# 88
z 93
] 65
x 80
5 85
p 82
Q 90
9 84
2 86
@ 148
< 65
T 70
» 85
6 84
C 69
k 80
70
+ 64
A 72
{ 72
= 82
& 105
62
* 75
3 87
$ 99
j 77
4 74
| 56
7 67
8 84
_ 57
\ 60
: 76
X 82
K 87
} 75
" 76
é 99
£ 98
! 72
> 60
I 63
· 58
Y 77
/ 44
G 93
[ 66
§ 117
• 41
° 71
' 54
Z 87
% 124
— 68
© 132

View File

@@ -0,0 +1,113 @@
112
NULL 0
t 3
h 3
r 3
o 3
u 3
g 3
N 5
e 3
w 3
S 5
F 5
i 3
n 3
d 3
f 3
a 3
m 3
l 3
y 3
s 3
¢ 0
¥ 0
q 3
V 5
L 5
U 5
v 3
E 5
H 5
` 0
¤ 0
B 5
P 5
c 3
O 5
J 5
( 0
€ 0
1 8
, 0
0 8
. 0
) 0
“ 0
R 5
” 0
D 5
M 5
b 3
- 0
; 0
W 5
® 0
? 0
~ 0
# 0
z 3
] 0
x 3
5 8
p 3
Q 5
9 8
2 8
@ 0
< 0
T 5
» 0
6 8
C 5
k 3
0
+ 0
A 5
{ 0
= 0
& 0
0
* 0
3 8
$ 0
j 3
4 8
| 0
7 8
8 8
_ 0
\ 0
: 0
X 5
K 5
} 0
" 0
é 3
£ 0
! 0
> 0
I 5
· 0
Y 5
/ 0
G 5
[ 0
§ 0
• 0
° 0
' 0
Z 5
% 0
— 0
© 0

View File

@@ -0,0 +1,921 @@
a
absurdum
ac
acres
actions
adaption
adjustments
aerobes
affairs
agents
Alan
Albert
Alberta
Alfred
Alice
Alicia
alliances
americas
analysts
announcements
anouncements
apples
applications
apricots
architectures
areas
arguments
arrangements
Arthur
artists
arts
aspects
attitudes
attractions
auctions
aug
az
baccalaureat
backlit
bags
Barbara
Barnabas
Barry
beliefs
benchmarks
Betty
bi
bits
blades
bonaventure
brad
broadminded
broadway
broking
brows
Bruce
bs
buddha
buddhism
buddhist
buddhists
buffers
ca
caffein
calculational
calif
California
cam
cams
Canadian
cancelling
capitulated
caps
Carmel
Carolyn
Carroll
cars
cartridges
cassette
casuality
Catherine
centre
centres
chambermaid
chapters
characteristics
characters
Charles
cheesy
cherokee
Chicago
chloride
Christopher
Chrysler
Churchill
Cicero
cinema
cinemas
Claire
Clara
clark
cleaners
clients
cliffs
clubs
co
codirector
coinsurance
Columbus
combinations
combust
combustor
comparisons
components
computerised
computers
con
concepts
conclusions
connections
connectors
consequences
contemporizing
continued
contra
contractors
controls
coprocessor
corequisite
corp
corridors
corrosive
costmetology
counterparts
cpu
crops
cueing
culturess
curtis
customers
cuts
cutout
cyanide
Czechoslovakia
dan
databases
David
Davis
days
dealership
Deborah
debut
decibles
declarations
deductible
defrayed
degrees
deionized
demobilisation
densily
departments
descriptions
desensitization
desktop
developers
developments
devices
dharma
diameters
Dianne
dicators
differences
digitising
directions
directorate
disadvantages
disassembly
disclosures
discos
discs
discusing
disks
districts
doe
dogs
dominican
dominicans
Donald
dos
dots
Douglas
Douglass
downsize
downsized
drugs
dumplings
duns
eastside
ecconomic
ecconomics
ed
Edward
efforts
Egypt
eh
Einstein
Einsteins
Elaine
electrophotography
elements
Elizabeth
Elliot
emory
emulsion
energized
enquiry
ent
enthusiasts
entrylevel
environments
epilepsy
epistemic
er
eric
erosion
errors
estuary
et
events
everyone's
exactions
exegesis
exhilarating
expenditures
explanations
explicably
expo
ext
extensions
eyelevel
facts
fastidious
fathers
favourably
fax
feb
feint
ferneries
files
filters
Finland
fireplaces
flavours
flights
fluency
fluidized
fluorescent
fm
forceps
forces
forefront
foreknowledge
forman
formfeed
formletters
Francisco
Frankfurt
friends
frond
fronds
frontage
frontseat
ft
functions
funds
futures
futuristic
ga
Galileo
Garfield
Gary
gaskets
geiger
geist
gentiles
Georgia
georgian
giants
gigabytes
glitches
Gloria
gm
gods
gordon
governments
gravitated
gremlins
greyhound
Griffith
groups
guages
Gwen
Hague
halftone
halftones
handfull
hans
hardcopy
harkness
Harold
Harris
haven't
Hawaii
hazards
headlights
headquartered
Helen
helicopter
helicopters
Henderson
herbalists
hermeneutical
hills
hindu
historians
ho
hoc
homeowners
honduras
hong
hours
houses
Howard
hr
hrs
humours
hwy
hyper
hypercard
hypertalk
hz
i
I'd
i.e.
i/o
IBM
iceskating
id
Idaho
ideas
identification
identify
ie
ii
iii
imaged
implementations
inc
individuals
inferences
infrastructure
inoculation
inspectors
instructions
inter
interpretative
intro
intrusive
intrusives
irs
isaac
iso
Italy
its
iv
ix
Jackson
jaguar
Jan
Jane
Jeanne
Jed
Jennie
Jennings
jets
jew
jewish
Joe
John
Jonathan
Joseph
Joyce
jr
jurist
ka
Kansas
Karl
kbytes
Kenneth
Kepler
keyboards
kg
kids
Kirk
kits
knockout
Kong
la
labels
lakeshore
lama
lamps
lan
laptop
Larry
laserjet
laserwriter
latin
Lawrence
laws
layouts
lb
lbs
lcd
le
leaching
Lebanon
leo
leon
Lewis
licensee
licensees
limitations
limpid
Lincoln
Linda
lines
listings
literatures
lithographic
lithography
logo
London
Louis
Lynda
ma
mac
mach
machines
macintosh
macintoshes
maddened
magnetically
manmade
manufacturers
Margaret
Maria
marriages
Martha
Martin
Marvin
Mary
mbyte
mbytes
MD
meads
meals
measurements
mechanics
med
megabit
megabyte
megabytes
members
menus
mesa
methods
Mexico
Meyer
mg
MHz
Michael
micro
microbes
microbial
microbiological
microbiology
microorganism
microorganisms
microsoft
midrange
miles
mils
min
ming
mini
minors
mips
mirages
misnamed
missioned
Missouri
ml
mm
mobilisation
modules
monarchic
monastary
monochrome
month's
Moscow
motorways
msg
mt
multi
multimedia
multiuser
Nurray
museums
nasa
Nathan
nations
nd
ne
Nelson
neoprene
networks
newsletter
Newton
nicholas
nitrate
NJ
nonessential
nonimpact
noninfectious
normative
northside
nov
ns
nuns
nutrients
NY
o
odometer
oem
offcampus
offchip
offsets
offshore
ohm
Olsen
omni
onchip
ondemand
ones
opinions
optimised
options
orchards
oregon
organisations
organise
organises
organising
orginal
os
ot
Otto
outlets
outmoded
overdrive
overdrives
Owens
pages
paperless
papers
Paris
parkway
passages
passengers
passengerside
patio
Paul
payload
pb
pc
pcs
pedal
pedals
penicillin
peoples
perambulate
perils
periods
persons
pesticides
petri
pharmacological
phd
phenomenalists
pheobe
Phil
Philip
philosophers
phlegm
photolithography
photometer
photometrically
photosensitive
phototypsetter
Pierre
plainpaper
plans
platonic
platonism
plc
plots
pluralism
pm
pocketsized
Polly
poly
polygons
polypropylene
popup
potency
pre
precautions
precepts
premises
prep
prerecorded
presswork
pretested
primal
primo
problems
procedures
processors
prod
profits
programme
programs
promissory
propane
protestant
proto
protocols
prudential
ps
pubs
racism
racist
rad
radioactive
rads
Ralph
ramirez
rashers
raster
rd
reactions
realists
realtor
realty
reardeck
rearview
recalibration
recipients
recommendations
recut
redskins
reductions
ref
reflections
refund
reimburse
rel
requirements
resettable
residues
resources
restaurants
rev
revue
rh
rhizomes
rhodes
richard
rickey
risc
rn
Robert
Roberts
rom
roots
Rosemary
rotor
rotors
rovers
rpm
rt
rugby
rumania
rumohra
rumours
Ryan
ryhthm
s
sacrament
sales
samaritan
San
Sandra
santa
Sarah
savagery
schemes
scholasticism
schuler
sciencefiction
sciencehistory
scientists
scripts
scsi
sculptors
se
Sean
Seattle
sec
sel
selectable
selectivity
selfpaced
semesters
sensors
Sept
sets
shareholders
sheerest
Shelley
Sheridan
ships
Shirley
shortcomings
Sidney
sig
sinch
Sinclair
singlesheet
singleuser
sinkhole
sists
skiers
slots
socalled
solidstate
souls
sources
southeast
soy
spa
spans
spilt
splines
spots
sq
squelched
sr
st
Stacey
stacks
standalone
states
steps
sterility
Stevens
stoics
stoves
streakings
stucco
students
stylus
sulfuric
summa
summarise
summers
sums
surveyors
susceptibility
swab
swabs
Swiss
Switzerland
sys
systems
t
Taylor
teaparty
tech
techniques
tel
temperatures
Terry
tests
th
theatre
theatres
thinning
thirdparty
Thomas
tickets
timeout
Timothy
tm
Tokyo
tollfree
tom
topics
torah
touted
towels
toxin
toxins
trademarks
traditions
trans
transfers
treatments
trees
trenchant
tribes
trinity
turbidity
turnaround
tx
types
typeset
typesetter
typestyles
typology
U.S.
UK
ultrafine
unassisted
undercut
units
unix
upchucking
upriver
ups
urea
USA
userfriendly
users
utilise
utilised
v
va
vacillated
vehicles
vendors
veneer
vernal
vi
victorian
videotex
Vienna
vii
viii
visitors
vitro
viva
vol
vols
volumes
vt
Wallace
Walter
walz
Wang
warmup
wastebasket
Wayne
ways
weatherproof
well
wellknown
welt
Wesley
westminster
weston
Williams
winchester
windows
Winston
wireframe
Wisconsin
wittmann
words
workstation
workstations
worlds
wows
wraps
x
xerographic
xi
xii
xiii
xiv
xix
xv
xvi
xvii
xviii
xx
years
Yugoslavian
zealots
zion

View File

@@ -0,0 +1,303 @@
Imports iTextSharp.text.pdf
Imports iTextSharp.text
Imports System.IO
Imports System.Text
Imports System.Xml
Imports System.Text.RegularExpressions
Imports System.Windows.Forms
Imports System.Drawing.Imaging
Public Class iTextSharpUtil
Public Shared mBookmarkList As New ArrayList
Public Shared Function GetPDFPageCount(ByVal filepath As String, Optional ByVal userPassword As String = "") As Integer
Dim oPdfReader As PdfReader
If userPassword <> "" Then
Dim encoding As New System.Text.ASCIIEncoding()
oPdfReader = New PdfReader(filepath, encoding.GetBytes(userPassword))
Else
oPdfReader = New PdfReader(filepath)
End If
Dim page_count As Integer = oPdfReader.NumberOfPages
oPdfReader.Close()
Return page_count
End Function
Public Shared Function GetPDFPageSize(ByVal filepath As String, ByVal pageNumber As Integer, Optional ByVal userPassword As String = "") As Drawing.Size
Dim oPdfReader As PdfReader
If userPassword <> "" Then
Dim encoding As New System.Text.ASCIIEncoding()
oPdfReader = New PdfReader(filepath, encoding.GetBytes(userPassword))
Else
oPdfReader = New PdfReader(filepath)
End If
Dim page_count As Integer = oPdfReader.NumberOfPages
If pageNumber >= 1 And pageNumber <= page_count Then
Dim rect As iTextSharp.text.Rectangle = oPdfReader.GetPageSize(pageNumber)
GetPDFPageSize.Height = rect.Height
GetPDFPageSize.Width = rect.Width
End If
oPdfReader.Close()
End Function
Public Shared Function GetOptimalDPI(ByVal filepath As String, ByVal pageNumber As Integer, ByRef oPictureBox As PictureBox, Optional ByVal userPassword As String = "") As Integer
GetOptimalDPI = 0
Dim pageSize As Drawing.Size = GetPDFPageSize(filepath, pageNumber, userPassword)
If pageSize.Width > 0 And pageSize.Height > 0 Then
Dim picHeight As Integer = oPictureBox.Height
Dim picWidth As Integer = oPictureBox.Width
Dim dummyPicBox As New PictureBox
dummyPicBox.Size = oPictureBox.Size
If (picWidth > picHeight And pageSize.Width < pageSize.Height) Or (picWidth < picHeight And pageSize.Width > pageSize.Height) Then
dummyPicBox.Width = picHeight
dummyPicBox.Height = picWidth
End If
Dim HScale As Single = dummyPicBox.Width / pageSize.Width
Dim VScale As Single = dummyPicBox.Height / pageSize.Height
dummyPicBox.Dispose()
If HScale < VScale Then
GetOptimalDPI = Math.Floor(72 * HScale)
Else
GetOptimalDPI = Math.Floor(72 * VScale)
End If
End If
End Function
Public Shared Sub FillTreeRecursive(ByVal arList As ArrayList, ByVal treeNodes As TreeNode)
For Each item As Object In arList
Dim tn As New TreeNode(item("Title"))
Dim ol As iTextOutline
ol.Title = item("Title")
ol.Action = item("Action")
ol.Named = item("Named")
ol.Page = item("Page")
tn.Tag = ol
treeNodes.Nodes.Add(tn)
If Not Nothing Is item("Kids") Then
FillTreeRecursive(item("Kids"), tn)
End If
Next
End Sub
Public Shared Function BuildBookmarkTreeFromPDF(ByVal FileName As String, ByVal TreeNodes As TreeNodeCollection, Optional ByVal userPassword As String = "") As Boolean
TreeNodes.Clear()
Dim oPdfReader As PdfReader
If userPassword <> "" Then
Dim encoding As New System.Text.ASCIIEncoding()
oPdfReader = New PdfReader(FileName, encoding.GetBytes(userPassword))
Else
oPdfReader = New PdfReader(FileName)
End If
Dim pageCount As Integer = oPdfReader.NumberOfPages
Dim arList As ArrayList = New ArrayList()
arList = SimpleBookmark.GetBookmark(oPdfReader)
oPdfReader.Close()
If Nothing Is arList Then
Return False
End If
Dim CurrentNode As New TreeNode
CurrentNode = TreeNodes.Add("Bookmarks")
FillTreeRecursive(arList, CurrentNode)
Return True
End Function
'Dim format As String = "<li><a href=""javascript:changeImage('images/page{0}.png')"">{1}</a></li>"
Public Shared Function BuildHTMLBookmarks(ByVal FileName As String, Optional ByVal userPassword As String = "") As String
Dim oPdfReader As PdfReader
If userPassword <> "" Then
Dim encoding As New System.Text.ASCIIEncoding()
oPdfReader = New PdfReader(FileName, encoding.GetBytes(userPassword))
Else
oPdfReader = New PdfReader(FileName)
End If
Dim numberOfPages As Integer = oPdfReader.NumberOfPages
Dim arList As ArrayList = New ArrayList()
arList = SimpleBookmark.GetBookmark(oPdfReader)
oPdfReader.Close()
If Nothing Is arList Then
BuildHTMLBookmarks = "<ul>"
For i As Integer = 1 To numberOfPages
BuildHTMLBookmarks &= "<li><a href=""javascript:changeImage('images/page" & i & ".png')"">Page " & i & "</a></li>"
Next
BuildHTMLBookmarks &= "</ul>"
Exit Function
Else
BuildHTMLBookmarks = ""
fillRecursiveHTMLTree(arList, BuildHTMLBookmarks)
Exit Function
End If
End Function
Public Shared Sub fillRecursiveHTMLTree(ByVal arList As ArrayList, ByRef strHtml As String)
strHtml &= "<ul>"
For Each item As Object In arList
Dim i As String = Regex.Replace(item("Page"), "(^\d+).+$", "$1")
strHtml &= "<li><a href=""javascript:changeImage('images/page" & i & ".png')"">" & Web.HttpUtility.HtmlEncode(item("Title")) & "</a></li>"
If Not Nothing Is item("Kids") Then
fillRecursiveHTMLTree(item("Kids"), strHtml)
End If
Next
strHtml &= "</ul>"
End Sub
Public Shared Function GraphicListToPDF(ByVal psFilenames As String() _
, ByVal outputFileName As String _
, ByVal psPageSize As iTextSharp.text.Rectangle _
, Optional ByVal language As String = "" _
, Optional ByVal StartPage As Integer = 0 _
, Optional ByVal EndPage As Integer = 0 _
, Optional ByVal UserPassword As String = "" _
, Optional ByVal OwnerPassword As String = "")
Dim StatusDialog As New ImportProgress
StatusDialog.TopMost = True
StatusDialog.Show()
Dim document As iTextSharp.text.Document
document = New Document(psPageSize, 0, 0, 0, 0)
Try
Dim writer As PdfWriter = PdfWriter.GetInstance(document, New FileStream(outputFileName, FileMode.Create))
If UserPassword <> "" Or OwnerPassword <> "" Then
writer.SetEncryption(PdfWriter.STRENGTH128BITS, UserPassword, OwnerPassword, PdfWriter.AllowCopy Or PdfWriter.AllowPrinting)
End If
document.Open()
Dim cb As PdfContentByte = writer.DirectContent
Dim fileNumber As Integer = 0
For Each psFileName As String In psFilenames
Dim ProgressIncrement As Integer = 100 / psFilenames.Length
fileNumber += 1
StatusDialog.UpdateProgress("Processing file " & fileNumber & "/" & psFilenames.Length, 0)
Application.DoEvents()
Dim bm As New System.Drawing.Bitmap(psFileName)
Dim total As Integer = bm.GetFrameCount(FrameDimension.Page)
If StartPage = 0 And EndPage = 0 Then
StartPage = 1
EndPage = total
End If
For k As Integer = StartPage To EndPage
StatusDialog.UpdateProgress("Processing page " & k & "/" & EndPage & " for file " & fileNumber & "/" & psFilenames.Length, ProgressIncrement / EndPage)
Application.DoEvents()
bm.SelectActiveFrame(FrameDimension.Page, k - 1)
'Auto Rotate the page if needed
If (psPageSize.Height > psPageSize.Width And bm.Width > bm.Height) _
Or (psPageSize.Width > psPageSize.Height And bm.Height > bm.Width) Then
document.SetPageSize(psPageSize.Rotate)
Else
document.SetPageSize(psPageSize)
End If
document.NewPage()
Dim img As iTextSharp.text.Image
img = iTextSharp.text.Image.GetInstance(bm, bm.RawFormat)
Dim Xpercent As Single = document.PageSize.Width / img.Width
Dim Ypercent As Single = document.PageSize.Height / img.Height
Dim ScalePercentage As Single
If Xpercent < Ypercent Then
ScalePercentage = Xpercent
Else
ScalePercentage = Ypercent
End If
img.ScalePercent(ScalePercentage * 100)
Dim xPos As Integer = (document.PageSize.Width - (img.Width * ScalePercentage)) / 2
Dim yPos As Integer = (document.PageSize.Height - (img.Height * ScalePercentage)) / 2
img.SetAbsolutePosition(xPos, yPos)
Try
If language <> "" Then
StatusDialog.UpdateProgress("OCR reading page " & k & "/" & EndPage & " for file " & fileNumber & "/" & psFilenames.Length, 0)
Application.DoEvents()
Dim bf As BaseFont = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED)
cb.BeginText()
Dim indexList As List(Of PDFWordIndex)
indexList = TesseractOCR.GetPDFIndex(bm, language)
StatusDialog.UpdateProgress("Adding search text to page " & k & "/" & EndPage & " for file " & fileNumber & "/" & psFilenames.Length, 0)
Application.DoEvents()
For Each item As PDFWordIndex In indexList
Dim fontSize As Single = item.FontSize
Dim text As String = item.Text
cb.SetColorFill(Color.WHITE) 'make text invisible in background
'Must convert image x,y (x units per inch) to PDF x,y (72 units per inch)
'Must know PDF page size to calculate the scale factor
'Must invert Y coordinate so we go top -> bottom
Dim x As Integer = (item.X * ScalePercentage) + xPos
Dim y As Integer = (item.Y * ScalePercentage) + yPos
y = (document.PageSize.Height - y) - fontSize
'Keep adjusting the font size until the text is the same width as the word rectangle
Dim desiredWidth As Integer = Math.Ceiling(item.Width * ScalePercentage)
Dim desiredHeight As Integer = Math.Ceiling(item.Height * ScalePercentage)
Dim renderFontWidth As Integer = bf.GetWidthPoint(text, fontSize)
While renderFontWidth < desiredWidth
fontSize += 0.5F
renderFontWidth = bf.GetWidthPoint(text, fontSize)
End While
cb.SetFontAndSize(bf, fontSize)
y = y - (fontSize - item.FontSize) / 2
cb.ShowTextAlignedKerned(Element.ALIGN_JUSTIFIED_ALL, text, x, y, 0)
Next
cb.EndText()
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Try
StatusDialog.UpdateProgress("Adding image to PDF of page " & k & "/" & EndPage & " for file " & fileNumber & "/" & psFilenames.Length, 0)
Application.DoEvents()
cb.AddImage(img)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Next
bm.Dispose()
Next
document.Close()
StatusDialog.Close()
GraphicListToPDF = outputFileName
Catch de As Exception
StatusDialog.Close()
MsgBox(de.Message)
'Console.[Error].WriteLine(de.Message)
'Console.[Error].WriteLine(de.StackTrace)
GraphicListToPDF = ""
End Try
End Function
Public Shared Function IsEncrypted(ByVal pdfFileName As String) As Boolean
IsEncrypted = False
Try
Dim oPDFReader As New PdfReader(pdfFileName)
oPDFReader.Close()
Catch ex As BadPasswordException
IsEncrypted = True
End Try
End Function
Public Shared Function IsPasswordValid(ByVal pdfFileName As String, ByVal Password As String) As Boolean
IsPasswordValid = False
Try
Dim encoding As New System.Text.ASCIIEncoding()
Dim oPDFReader As New PdfReader(pdfFileName, encoding.GetBytes(Password))
oPDFReader.Close()
IsPasswordValid = True
Catch ex As BadPasswordException
'Authentication Failed
End Try
End Function
End Class
Public Structure iTextOutline
Dim Title As String
Dim Action As String
Dim Page As String
Dim Named As String
Dim Position As Drawing.Point
End Structure

View File

@@ -0,0 +1,4 @@
All of these files must be in the same directory as PDFView.dll
The tessdata folder and all of it's contents must be in the same directory as tessnet2.dll
If you are running 64 bit, please replace the DLLs here with their 64 bit versions from the x64 directory.

Some files were not shown because too many files have changed in this diff Show More