mvc open pdf file in new window : Convert pdf to text without losing formatting software Library project winforms .net windows UWP msmanual0-part1862

XMLPDFLibrary
.NETProgrammersGuide
Version5.5.7 16November2006
ProducedwithXMLPDF5.5.7M
www.xmlpdf.com
Convert pdf to text without losing formatting - software Library project:C# PDF Convert to Text SDK: Convert PDF to txt files in C#.net, ASP.NET MVC, WinForms, WPF application
C# PDF to Text (TXT) Converting Library to Convert PDF to Text
www.rasteredge.com
Convert pdf to text without losing formatting - software Library project:VB.NET PDF Convert to Text SDK: Convert PDF to txt files in vb.net, ASP.NET MVC, WinForms, WPF application
VB.NET Guide and Sample Codes to Convert PDF to Text in .NET Project
www.rasteredge.com
XMLPDF5.5.7ProgrammersGuide
November2006
Contents
Introduction 1
1.1
WhycreatePDFfiles? 1
1.2
WhyusePDFinsteadofHTML? 1
1.3
DevelopmentEnvironments 1
1.4
DoIneedtoknowaboutthePDFfileformat? 1
1.5
Aboutthismanual 1
Features 2
2.1
Documenttemplates 2
2.2
TextFormatting 2
2.3
Fonts 2
2.4
Images 2
2.5
Pagination 3
2.6
Tables 3
2.7
MergingData 3
2.8
Styles 3
2.9
Links 3
2.10
Sequences 3
Installation 4
Usage 5
4.1
Introduction 5
4.2
HelloworldXMLfile 5
4.3
API 5
4.4
XMLValidation 7
4.5
Versions 7
4.6
LicenseFile 7
C#Example 9
5.1
C#Code 9
5.2
StepbyStep 9
VisualBasicExample 12
ASP.NETExample 15
ASP.NETVirtualDirectories 16
XMLCharactersandEntities 17
9.1
EscapingXMLCharacters 17
9.2
UsingXMLEntities 18
10 UnitsofMeasurement 19
10.1
Units 19
10.2
Pagesizes 20
10.3
Custompagesizes 20
10.4
Pageorientation 20
10.5
Margins 20
www.xmlpdf.com
software Library project:VB.NET Create PDF from PowerPoint Library to convert pptx, ppt to
VB.NET merge PDF files, VB.NET view PDF online, VB.NET convert PDF to tiff, VB.NET read PDF, VB.NET convert PDF to text, VB.NET Convert to PDF with embedded
www.rasteredge.com
software Library project:VB.NET Create PDF from Word Library to convert docx, doc to PDF in
Export all Word text and image content into high quality PDF without losing formatting. Create PDF files from both DOC and DOCX formats. Convert multiple pages
www.rasteredge.com
XMLPDF5.5.7ProgrammersGuide
November2006
10.6
Defaultvalues 21
11 Fonts 22
11.1
Basics 22
11.2
Changingfonts 22
11.3
Lineheightorleading 23
11.4
TrueTypefonts 23
11.5
Unicodefonts 24
12 DocumentStructure 25
12.1
Basics 25
12.2
XMLencoding 25
12.3
Documentelement 26
12.4
Fontselement 26
12.5
Imageselement 26
12.6
Contentelements 27
12.7
Formattingelements 31
12.8
Newpageelement 31
12.9
DynamicAttributes 31
13 TextFormatting 32
13.1
Basics 32
13.2
Horizontalalignment 32
13.3
Verticalalignment 32
13.4
Textcolor 33
13.5
Underlineandstrikethrough 33
13.6
Spaceafter 33
13.7
Spacebefore 33
13.8
Forcingspacebefore 34
13.9
Indentleft 34
13.10 Indentright 34
13.11 Kerning 34
13.12 Keeptogether 34
13.13 Keepspaces 34
13.14 Leading 35
13.15 Rise 35
13.16 NonBreakingSpace 35
13.17 ChangingTextFormatting 35
14 PageNumbering 37
14.1
Basics 37
14.2
Breaks 37
14.3
Grouping 37
15 Colors 38
15.1
Basics 38
15.2
PredefinedColors 38
15.3
CustomColors 38
15.4
CMYKColors 38
16 Tables 39
16.1
Basics 39
16.2
Columnwidths 39
16.3
Borders 40
www.xmlpdf.com
software Library project:VB.NET Create PDF from Excel Library to convert xlsx, xls to PDF
images, C#.NET PDF file & pages edit, C#.NET PDF pages extract, copy, paste, C#.NET rotate PDF pages, C#.NET search text in PDF Convert to PDF with embedded
www.rasteredge.com
software Library project:C# Create PDF from Word Library to convert docx, doc to PDF in C#.
A convenient C#.NET control able to turn all Word text and image content into high quality PDF without losing formatting. Convert multiple pages Word to
www.rasteredge.com
XMLPDF5.5.7ProgrammersGuide
November2006
16.4
RoundedCorners 41
16.5
Linestyles 41
16.6
Bordercolors 42
16.7
Cellpadding 42
16.8
Nestedtables 42
16.9
Rowheight 43
16.10 Newspaperlayout 44
16.11 Otherattributes 46
17 LinesandBoxes 48
17.1
DrawingBoxes 48
17.2
DrawingLines 48
18 Images 49
18.1
Basics 49
18.2
ImageSize 51
18.3
ImageResolution 52
18.4
Mergingthefile-namevalue 52
18.5
UsingScalableVectorGraphics 52
19 Styles 55
19.1
Basics 55
20 DocumentSecurity 56
20.1
Passwords 56
20.2
Restrictions 56
20.3
Example 56
21 ErrorHandling 58
21.1
Basics 58
21.2
LoggingtoFile 58
21.3
LoggingtoAStream 58
21.4
LoggingtoSystem.Diagnostics.Trace 59
21.5
LoggingtoMultipleDestinations 59
22 MergingData 60
22.1
Basics 60
22.2
Conditionalprocessing 60
22.3
MergingFieldsfromXMLusingXPathexpressions 61
22.4
IntegrationwithADO.NET 67
23 Links 69
23.1
Basics 69
23.2
MergingtheURLValue 70
24 PositioningOutput 71
24.1
AbsolutePositioning 71
24.2
RelativePositioning 71
25 CreatingaTableofContents 72
25.1
CreatingaTableOfContents 72
25.2
TableOfContentsPageLayout 73
www.xmlpdf.com
software Library project:C# Create PDF from Excel Library to convert xlsx, xls to PDF in C#
An excellent .NET control support convert PDF to multiple Excel formats in C#.NET Turn all Excel spreadsheet into high quality PDF without losing formatting.
www.rasteredge.com
software Library project:C# Create PDF from PowerPoint Library to convert pptx, ppt to PDF
Excellent .NET control for turning all PowerPoint presentation into high quality PDF without losing formatting in C#.NET Class. Convert to PDF with embedded
www.rasteredge.com
XMLPDF5.5.7ProgrammersGuide
November2006
26 Reference 75
26.1
<auto-sequence-get> 75
26.2
<auto-sequence-get-name> 75
26.3
<auto-sequence-inc> 76
26.4
<begin-page-number-group> 77
26.5
<boxes> 77
26.6
<block> 79
26.7
<br> 80
26.8
<cell> 81
26.9
<condition> 82
26.10 <conditions> 82
26.11 <data> 82
26.12 <define-sequence> 82
26.13 <document> 84
26.14 <forward-reference> 85
26.15 <font> 85
26.16 <fonts> 85
26.17 <graphic> 86
26.18 <header> 86
26.19 <image> 87
26.20 <images> 88
26.21 <if> 88
26.22 <ifnot> 88
26.23 <info> 89
26.24 <link> 89
26.25 <merge> 89
26.26 <new-page> 90
26.27 <next-page> 90
26.28 <page-footer> 90
26.29 <page-header> 90
26.30 <page-number> 91
26.31 <restore> 91
26.32 <row> 92
26.33 <sequence-get> 93
26.34 <segment> 93
26.35 <show-image> 94
26.36 <set> 96
26.37 <space> 96
26.38 <span> 96
26.39 <style> 97
26.40 <table> 99
26.41 <watermark> 100
26.42 <xref> 101
www.xmlpdf.com
software Library project:VB.NET PDF Convert to Word SDK: Convert PDF to Word library in vb.
finish high-fidelity PDF to Word conversion without depending on pictures and font formatting of source PDF file are Why do we need to convert PDF to Word file
www.rasteredge.com
xmlpdfusermanualpage1of101
XMLPDF5.5.7ProgrammersGuide
November2006
1:Introduction
CHAPTER1
Introduction
ThisistheusermanualfortheXMLPDFlibrary. TheXMLPDFlibrarycreates
PDFdocumentsdynamicallyfromJavaand.NETprogrammingenvironments.
1.1
Why create PDF files ?
IndustrystandardPortable Document Format(PDF)filesprovide aconvenient
waytodistributedocumentsandforms. PDFfilesareplatform-independent,so
someoneviewing your documentwillseeexactlythe same thing on different
operatingsystemssuchasWindowsandLinux. PDFdocumentsprovideprecise
control over formatting and alignment and produce the same output on all
printers.
MostwebbrowserssupportPDFfilesthroughintegrationwithAdobeAcrobat.
WithXMLPDFyoucancreatePDFfilesdynamicallyandstreamthemdirectly
tothebrowserfromyourapplicationwithoutrequiringtheybesavedtodisk.
1.2
Why use PDF instead of HTML ?
PDFfilesareusedinsteadofHTMLforthefollowingreasons:
¤Consistentoutput. WhenauserprintsaPDFdocumenttheygetwhatthey
expect. WhentheyprintanHTMLpagewhattheygetdependsonwhich
browserversiontheyarerunningandhowitinteractswiththeprinterdriver.
¤Correctfonts. XMLDPFallowsyoutoembedfontsintoadocumentsothat
thedocumentwillprintwiththefontsspecified,notthefontswhichhappento
beinstalledontheusersmachine.
¤Security.PDFdocumentsaremuchmoredifficultforausertoalterthan
HTMLorWorddocuments.
¤Precisionformatting. UsingPDFallowsyoutospecifyexactlythewidths
oftablecolumnssothedocumentlooksthesameonallsystems.
1.3
Development Environments
The .NETversionof XMLPDF isdeveloped inC#and delivered asa single
assembly called xmlpdf.dll. This can be used as an application-specific
assembly.
TheJavaversionofXMLPDFisdevelopedinJava1.2anddeliveredasasingle
jarcalledxmlpdf-1.0.jar. ThiscanbeusedwithJDK/JREversions1.2and1.3.
1.4
Do I need to know about the PDF file format ?
No. ThecomplexitiesofthePDFformatarecompletelyhidden.
1.5
About this manual
Thismanual wasproduced using XMLPDF version 5.5.7M. Body text isin
TimesRoman10/13,headingsareHelvetica12.AsubsetofGaramondandof
ArialisembeddedtodemonstrateUnicodefonts.
AcrobatuserscanpressCtrl-Alt-Ftoseealistofallthefontsinthisdocument.
www.xmlpdf.com
xmlpdfusermanualpage2of101
XMLPDF5.5.7ProgrammersGuide
November2006
2:Features
CHAPTER2
Features
2.1
Document templates
XMLPDF allows you to define the format of a PDFdocument in XMLand
generatethedocumentdynamically,includingpopulatingfieldsinthedocument
templatefromanothersourcesuchasadatabase.
2.2
Text Formatting
XMLPDFhaspowerfultextformattingfeaturesincluding:
Alignment
Textcanbeleftaligned,rightaligned,centeredandjustified.
Formatting
Textcanbedisplayedinbold,italic,underline
Textcanbedisplayedinsuperscriptandsubscript.
Kerning
Textisautomaticallykernedsothatwherefontssupportitthe
gapbetweencharacterschangesforeachcharacterpair. This
resultsintextwhichlooksmoreprofessionalandiseasierto
read.
Pagination
Textandtablesareautomaticallysplitatpageboundaries.
Widow/Orphancontrolisprovidedsothatasinglelineisnever
leftatthebottomortopofapage.
2.3
Fonts
AllPDF viewerssupport 14standardfontsdefinedby Adobe. These include
Helvetica, Courier, Times, ZapfDingbats and Symbol, plus bold, italic and
bold-italic versionsof Helvetica,CourierandTimes.XMLPDFfully supports
thesefonts.
TrueType fonts are also fully supported. These fonts are embedded in the
document. AdoberecommendthatTrueTypefontsshouldalwaysbeembedded.
Unicode TrueType fontsare fully supported allowing display ofall Unicode
characterssupportedbythefont.
When TrueType font files are embedded in documents, XMLPDF creates a
subsetofthefontsothatonlyinformationfromtheTrueTypefontfilewhichis
actuallyneededisincludedinthePDF.Datarelatingtocharactersnotusedinthe
PDFdocumentisdiscarded.Thismeansyoucanuselargefontfilesandstillget
smallPDFdocuments.
SeeSection 11, "Fonts"formoreinformation.
2.4
Images
PNG,GIFandJPEGimagescanbeincludedinfilesproducedusingXMLPDF.
XMLPDFsupportsscalingimagestofitpagesizesandscalingtofitinsidetable
cells.
Imagescanbe positionedanywhereinthe document includinginheadersand
footers.
SeeSection 18, "Images"formoreinformation.
www.xmlpdf.com
xmlpdfusermanualpage3of101
XMLPDF5.5.7ProgrammersGuide
November2006
2:Features
2.5
Pagination
Textblocksandtablesareautomaticallysplitatpageboundaries. Tableheaders
canbeautomaticallyrepeatedwhereatableissplit.
Automaticnumberingofpagesandheadingsissupportedincluding'pageXof
Y'.
2.6
Tables
XMLPDFsupportsextensivetableformattingfunctionality. Tablescontaincells
whichinturncancontaintext,images,graphicsorothertables.
Table headers can be repeated automatically when tables are split by page
breaks.
SeeSection 16, "Tables"formoreinformation.
2.7
Merging Data
XMLPDF is designed for creating document templates in XML and then
mergingindatafromadatabase. Dataispresentedtothedocumentgeneration
processasXML,soitcanoriginatefromdatabases,existingXMLfiles,orany
othersourcefromwhichXMLcanbecreated.
Anyamountofdatacanbemergedfromsinglefieldstoentiretables.
SeeSection 22, "Merging Data"formoreinformation.
2.8
Styles
Astylecanbedefinedandthenautomaticallyappliedtotextorimagesmakingit
simpletoprovidealltheelementsofaPDFdocumentwithaconsistentlook. It
iseasytochangethelookofanentiredocumentbychangingasinglestyle.
SeeSection 19, "Styles"formoreinformation.
2.9
Links
HTTPhyperlinkscanbeplacedinthePDFfilesothatuserscanclickandopena
browserwindowatthelinkedaddress.Clickonthewww.xmlpdf.com
toseethis
inaction.
SeeSection 23, "Links"formoreinformation.
2.10
Sequences
Numbered sequences can be automatically allocated and displayed with
alphabetic,numericorromannumeralformats.
www.xmlpdf.com
xmlpdfusermanualpage4of101
XMLPDF5.5.7ProgrammersGuide
November2006
3:Installation
CHAPTER3
Installation
This chapter contains instructionson installing the XMLPDF library for the
.NETdevelopmentenvironment.
The XMLPDF library is distributed as a Windows Installer file. Run this
installertoinstalltheXMLPDFDLL'sandasampleapplicationwritteninVisual
Basic.NET. Thesourcecodeforthissampleprogramisincluded.
The installationinclude twoDLLs. XMLPDF.DLLiscompiledusingthe 1.0
FrameworkSDK,XMLPDF11.DLLiscompiledusingthe1.1FrameworkSDK.
Onceyouhave downloadedtheDLLyou caneitherreference itfromprojects
within Visual Studio by right-clicking on the project and selecting 'Add
reference'oryoucaninstallitinthesharedassemblyareausingtheappropriate
.NETutility.
Theexampleswhichfollowintheusagesectiondetailhowtocreatereferences
totheDLL.
www.xmlpdf.com
xmlpdfusermanualpage5of101
XMLPDF5.5.7ProgrammersGuide
November2006
4:Usage
CHAPTER4
Usage
4.1
Introduction
ThissectiondescribeshowtouseXMLPDFtogenerateaPDFfile. Examples
are included forgeneration ofa file fromVisualBasic,C# andfroman ASP
page.
4.2
Hello world XML file
ThesimplestexampleusingXMLPDFistheHelloWorld.xmlfilewhichcontains
this:
<document>
<block>
Hello World
</block>
</document>
ThisisalltheXMLnecessarytocreateaPDFfile. AllfeaturesofthePDFsuch
aspagesize,font,fontsizeetc.aresettodefaultvalues.
Thisfileisusedinalltheexampleswhichfollow.
4.3
API
All documentsare created using the generated method of the PDFDocument
object.
Different argumentsare used to distinguish the differentgeneratemethodsas
detailedhere:
4.3.1
XML File to PDF File
publicvoidgenerate(StringtemplateFileName,StringpdfFileName)
templateFileNameisthenameofthefileondiskwhichcontainsthetemplate
XML.
pdfFileNameisthenameofthefilewherethePDFfilewillbecreated. Ifthis
filealreadyexistsitisoverwritten.
UsethismethodtogenerateaPDFfilefromanXMLtemplatewherebothfiles
aredisk-basedandnodataismerged.
4.3.2
XML File to PDF File, Data in File
public voidgenerate(StringtemplateFileName, String pdfFileName, String
dataFileName)
templateFileNameisthenameofthefileondiskwhichcontainsthetemplate
XML.
pdfFileNameisthenameofthefilewherethePDFfilewillbecreated. Ifthis
filealreadyexistsitisoverwritten.
dataFileNameisthenameofthefilewhereXMLdatatobemergedintothe
templateisstored.
Use thismethodto generate a PDFfile froman XMLtemplate merging data
fromathirdfile,whereallfilesaredisk-based.
4.3.3
XML Document to PDF Stream
publicvoidgenerate(XmlDocumenttemplateDoc,StreampdfStream)
www.xmlpdf.com
Documents you may be interested
Documents you may be interested