asp.net open pdf file in web browser using c# : Adjust size of pdf in preview SDK Library service wpf asp.net azure dnn ibex1-part263

Installation
5
Chapter2
Installation
ThelatestversionofIbexcanbedownloadedfrom
http://www.xmlpdf.com/downloads-net.html.
The download file is a a Windows Installer r MSI I file which h can be e installed d by
double-clickingonitinWindowsExplorer.
BydefaultIbexisinstalledinthefollowingdirectory:
c:\programfiles\visualprogramming\ibexpdfcreatorn.n.n
wheren.n.nistheversionnumber.SoforexampleIbex4.1.2isinstalledin:
c:\programfiles\visualprogramming\ibexpdfcreator4.1.2
MultipleversionsofIbexcanbeinstalledandusedononemachineatthesametime.
2.1 Assembliesinstalled-IbexPDFCreatorStandardEdition
Theinstallationprocessinstallsthese.NETassembliesusedbyIbex:
.NETVersion
Assembly
Description
1.0(32bit)
ibex10.dll
MainIbexassembly
ibex10.exe
Ibexcommandlineutility
1.1(32bit)
ibex11.dll
MainIbexassembly
ibex11.exe
Ibexcommandlineutility
2.0(32bit)
ibex20.dll
MainIbexassembly
ibex20.exe
Ibexcommandlineutility
3.5(32bit)
ibex35.dll
MainIbexassembly
ibex35.exe
Ibexcommandlineutility
4.0(32bit)
ibex40.dll
MainIbexassembly
ibex40.exe
Ibexcommandlineutility
2.2 Assembliesinstalled-IbexPDFCreatorProfessional
Edition
Theinstallationprocessinstallsthese.NETassembliesusedbyIbex:
.NETVersion
Assembly
Description
1.0(32bit)
ibex10.dll
MainIbexassembly
ibex10.exe
Ibexcommandlineutility
Adjust size of pdf in preview - Compress reduce PDF size in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
C# Code & .NET API to Compress & Decompress PDF Document
change font size in pdf form field; best compression pdf
Adjust size of pdf in preview - VB.NET PDF File Compress Library: Compress reduce PDF size in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
VB.NET PDF Document Compression and Decompression Control SDK
reduce pdf file size; change font size pdf
IbexPDFCreator
DevelopersGuide
6
Installation
.NETVersion
Assembly
Description
1.1(32bit)
ibex11.dll
MainIbexassembly
ibex11.exe
Ibexcommandlineutility
ibexshaping11.dll
ProvidesArabictextshapingsupport
2.0(32bit)
ibex20.dll
MainIbexassembly
ibex20.exe
Ibexcommandlineutility
ibexshaping20.dll
ProvidesArabictextshapingsupport
2.0(64bit)
ibex20-64.dll
MainIbexassembly
ibex20-64.exe
Ibexcommandlineutility
ibexshaping20-64.dll
ProvidesArabictextshapingsupport
3.5(32bit)
ibex35.dll
MainIbexassembly
ibex35.exe
Ibexcommandlineutility
ibexshaping35.dll
ProvidesArabictextshapingsupport
3.5(64bit)
ibex35-64.dll
MainIbexassembly
ibex35-64.exe
Ibexcommandlineutility
ibexshaping35-64.dll
ProvidesArabictextshapingsupport
4.0(32bit)
ibex40.dll
MainIbexassembly
ibex40.exe
Ibexcommandlineutility
ibexshaping40.dll
ProvidesArabictextshapingsupport
4.0(64bit)
ibex40-64.dll
MainIbexassembly
ibex40-64.exe
Ibexcommandlineutility
ibexshaping40-64.dll
ProvidesArabictextshapingsupport
2.3 Installingbycopyingfiles
Ibex can be installed as part of a larger application n by y copying the e assemblies
appropriatetothe.NETversionbeingusedandregisteringthemintheGAC.Itisnot
necessarytoruntheIbexinstallertousetheIbexassembliesontestandproduction
machines.Werecommendrunningtheinstallerondevelopmentmachinesasthiswill
installtheexamplefiles.
2.4 Assembliesnotrequiredinproduction
Typicallythecommandlineprograms(ibex*.exe)arenotusedonproductionservers
anddonotneedtobeinstalled.
Theibexshaping*.dllassembliesareusedforshapingArabictext.Theseassembliesare
loadeddynamicallyusingreflection.IfyourdocumentsdonotcontainArabictextthen
youdonotneedtoinstalltheseassemblies.
VB Imaging - VB Codabar Generator
image, New PointF(100F, 100F)) docx.Save("C:\\Sample_Barcode.pdf"). VB Code to Adjust Codabar Parameters. set barcode data // Codabar barcode size related barcode
change page size pdf; pdf reduce file size
VB.NET Image: Web Image and Document Viewer Creation & Design
configure the VB.NET image viewer or adjust its properties with mouse click and reset the size of the a powerful toolkit to print bitonal images, PDF, and so on
300 dpi pdf file size; best online pdf compressor
GettingStartedwithIbex
7
Chapter3
GettingStartedwithIbex
Althoughprimarilyintendedforuseasapartofalargerapplication,theIbexinstallation
includescommandlineprogramswhichcreatesPDFfilesfromXML,XSLTandXSL-FO
files.WewillusetheseprogramstodemonstratethebasicsofPDFcreationwithIbex.
The command line e programs shipped d with Ibex are ibex10.exe, ibex11.exe and
ibex20.exe.Usetheonewhichcorrespondstotheversionof.NETyouhaveinstalled.
ThroughoutthismanualanXMLfilewhichusestheXSLformattingobjectsvocabularyis
referredtoasanFOfileorjusttheFO.
The command line syntax x for all l versions s is s the same. . In n these e examples we use
ibex20.exe.
3.1 Ibexcommandlineprogramusage
TocreateaPDFfilefromaFOfilespecifythenamesoftheFOandPDFfilesonthe
commandline.Forexampletocreatehello.pdffromhello.foyoudothis:
ibex20 hello.fo hello.pdf
Ifthenamesoftheinputandoutputfilesarethesame(ignoringtheextensions)youcan
abbreviatethisto:
ibex20 hello.fo
andifthefileextensionoftheinputfileis"fo"or"xml"youcanabbreviateevenfurther
to:
ibex20 hello
3.2 Errorlogging
Anyinformationalorerrormessageswillbeloggedtotheconsole.Tosendanyerror
messagestoafileaswell,usethe-logfileoption.Forexample,tologerrorstothefile
ibex.logthecommandbecomes:
ibex20 -logfile ibex.log hello.fo hello.pdf
C# Image: View & Operate Web Page Using .NET Doc Image Web Viewer
multiple document and image formats, like PDF and TIFF; Adjust the page order of source document file using mouse NET users to choose best viewing size as they
change font size pdf document; best pdf compression tool
Generate and draw Data Matrix for Java
all 2D barcodes like QR Code, Data Matrix and PDF 417 in text in Java Class barcode.setData("Java Data Matrix"); //Adjust Data Matrix size with barcode
can a pdf file be compressed; pdf compression settings
IbexPDFCreator
DevelopersGuide
8
GettingStartedwithIbex
3.3 AnexamplewithoutXSLTtranslation
TheIbexcommandlineprogramwillcreateaPDFfilefromeither(a)anFOfileor(b)an
XMLfilewithanXSLTstylesheet.ThissectionshowshowtocreateaPDFfilefromanFO
file.
ThisexampleusestheFOfilehello.foshowninFigure3-1.
Figure3-1:
HelloWorldFO
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns="http://www.w3.org/1999/XSL/Format">
<layout-master-set>
<simple-page-master master-name="page">
<region-body margin="2.5cm" region-name="body"/>
</simple-page-master>
</layout-master-set>
<page-sequence master-reference="page">
<flow flow-name="body">
<block>Hello World</block>
</flow>
</page-sequence>
</root>
Eachoftheelementsandattributesusedinthefileisexplainedlaterinthemanual.For
nowwejustwanttogetstartedwithusingtheIbexcommandlineprogram.
Usingthecommand
ibex20 hello
createsthefilehello.pdfcontainingthetext"HelloWorld".
3.4 AnexamplewithXSLTtranslation
TheIbexcommandlineprogramwillcreateaPDFfilefromeither(a)anFOfileor(b)an
XMLfilewithanXSLTstylesheet.ThissectionshowshowtocreateaPDFfilefroman
XMLdatafilewithanXSLTstylesheet.
UsingIbexwithouthavingIbexdotheXSLTtransformationtocreatetheFOisusefulif
youhavecreatedtheFOusinganothertoolorifyoujustwanttomanuallychangesome
FOtoexperimentwithlayout.
InpracticeXSLTisalmostalwayspartofthePDFcreationprocessbecauseXSL-FOlacks
somesimplefeaturessuchasbeingabletosequentiallynumberheadings.Thedesigners
ofXSL-FOpresumedthatXSLTwouldbeusedandsodidnotduplicatefeaturesalready
inXSLT.
IbexgivesyoutheflexibilityofhavingIbexdotheXSLTtranslationorhavingsomeother
tooldoit.InternallyIbexusestheXSLTtranslationclassesprovidedby.NET.TheXSLT
classesin.NET2.0aresignificantlyfasterandusememorymoreefficientlythanin.NET
1.0and1.1.Forthisreasonwerecommendusing.NET2.0orlater.
InthisexamplewewilltranslatesomeXMLwithanXSLTstylesheetandproduceaPDF
fromtheresultofthetranslation.
Tutorial Guide for Java Barcode Generation Component in details
Package for the purpose type with linear, QR Code, PDF 417 or image text in Java Class barcode.setData("BARCODE-JAVA"); //Adjust Code 39 size with barcode
change file size of pdf; change paper size in pdf document
VB.NET Word: Create VB.NET Word Document Viewer in Web, Windows
Professional VB.NET Word document viewing component with quick thumbnail preview support; If needed, you can try VB.NET PDF document file viewer SDK, and VB.NET
reader pdf reduce file size; adjust size of pdf
IbexPDFCreator
DevelopersGuide
GettingStartedwithIbex
9
Wehavesomeweatherforecastdatainthefileweather.xml.ThisfilecontainstheXML
showninFigure3-2.
Figure3-2:
WeatherForecast
Data
<?xml version="1.0" encoding="UTF-8"?>
<forecast>
<city name="Wellington" temp="20"/>
</forecast>
WealsohaveanXSLTstylesheetweather.xslwhichcontainstheXSLshowninFigure3-3.
Figure3-3:
WeatherForecast
Stylesheet
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:ibex="http://www.xmlpdf.com/2003/ibex/Format">
<xsl:strip-space elements="*"/>
<xsl:template match="forecast">
<root xmlns="http://www.w3.org/1999/XSL/Format">
<layout-master-set>
<simple-page-master master-name="page-layout">
<region-body margin="2.5cm" region-name="body"/>
</simple-page-master>
</layout-master-set>
<page-sequence master-reference="page-layout">
<flow flow-name="body">
<xsl:apply-templates select="city"/>
</flow>
</page-sequence>
</root>
</xsl:template>
<xsl:template match="city">
<fo:block>
<xsl:value-of select="@name"/>
<xsl:value-of select="@temp"/>
</fo:block>
</xsl:template>
</xsl:stylesheet>
Thistemplateoutputstheroot, layout-master-setandpage-sequenceelements.Then
foreachcityrecordinthedataoutputsablockelementusingthetemplateshownin
Figure3-4.
Figure3-4:
weather-data-xsl-
subset
<xsl:template match="city">
<block>
<xsl:value-of select="@name"/>
&#160;
<xsl:value-of select="@temp"/>
</block>
</xsl:template>
Wecantranslateandformatthisexampleusingthecommand:
ibex20 -xsl weather.xsl weather.xml weather.pdf
Theresultofthistranslationisthefileweather.pdf
IbexPDFCreator
DevelopersGuide
10
GettingStartedwithIbex
3.5 Requiredskills
TouseIbexyouneedknowhowtoeditXSLstylesheets.SomefamiliaritywithXSLTis
required,althoughindepthknowledgeisnot.TheIbexwebsitecontainsexamplesof
usingXSLTforcommondocumentrelatedfunctionssuchascreatingatableofcontents.
FamiliaritywithXSL-FOis notrequired. . This s manualcontainsenoughinformationto
enableyoutoproducecomplexdocumentsusingIbex.
IntroductiontoXSL-FO
11
Chapter4
IntroductiontoXSL-FO
Thischapterprovidesanoverviewofformattingobjectsandprovidessomesuggestions
onhowtocreatePDFdocumentsfromXMLfiles.Wealsolookatthetechniquesfor
usingXSLTtransformationtocreateFOfiles.
4.1 LayoutofanFOfile
AverysimpleFOfileisshowninFigure4-1:
Figure4-1:
SimpleFOfile
<?xml version='1.0' encoding='UTF-8'?>
<root xmlns="http://www.w3.org/1999/XSL/Format">
<layout-master-set>
<simple-page-master master-name="simple">
<region-body margin="2.5cm" region-name="body"
background-color='#eeeeee'/>
</simple-page-master>
</layout-master-set>
<page-sequence master-reference="simple">
<flow flow-name="body">
<block>Hello World</block>
</flow>
</page-sequence>
</root>
Thisfileislogicallyinthreeparts,namelytheroot,layout-master-setandpage-sequence
parts.AllFOfilessharethisstructure.
4.1.1 Namespaces
TheexamplesusedinthismanualfollowthestyleshowninFigure4-1,wheretheXSL-FO
namespace is set (on n the e root element) as the e default t namespace for the file.
NamespaceprefixesarenotusedfortheFOelementssuchasblock.Figure4-2shows
thesameFOasFigure4-1butwithoutthedefaultnamespace.Eachelementhasthe
"fo:"namespaceprefix.ThefilesshowninFigure4-1andFigure4-2bothcreatethesame
outputandaretreatedequallybyIbex.Usingnamespacesisamatterofpreference,it
doesnoteffectperformance.
IbexPDFCreator
DevelopersGuide
12
IntroductiontoXSL-FO
Figure4-2:
SimpleXMLusingthe
foprefix
<?xml version='1.0' encoding='UTF-8'?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="simple">
<fo:region-body margin="2.5cm" region-name="body"
background-color='#eeeeee'/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="simple">
<fo:flow flow-name="body">
<fo:block>Hello World</block>
</fo:flow>
</fo:page-sequence>
</fo:root>
4.1.2 Therootelement
The root element t shown n in n Figure e 4-3 3 contains the e whole e content of f the e file e and
establishestheXSL-FOnamespaceasthedefaultnamespace.Thiselementisthesame
forallFOfiles.
Figure4-3:
Therootelement
<root xmlns="http://www.w3.org/1999/XSL/Format">
AdditionalnamespacescanbeaddedtothexmlelementasshowninFigure4-4.
Figure4-4:
Therootelementwith
additional
namespaces
<root xmlns="http://www.w3.org/1999/XSL/Format"
xmlns:ibex="http://www.xmlpdf.com/2003/ibex/Format"
xmlns:svg="xmlns="http://www.w3.org/2000/svg"
>
4.1.3 Thelayout-master-setelement
Thelayout-master-setelementshowinFigure4-5definestheshapeandlayoutofpages
inthedocument.Withinthelayout-master-setwehaveasimple-page-masterelement
whichinturncontainstheregion-bodyelement.
Thesimple-page-masterdefinesthelayoutofonetypeofpageandisuniquelyidentified
by its master-name attribute. The region-bodyelement defines anarea ofthe page
wherecontentwillbeplaced.Apagecanhavemorethanoneregionsowegivethe
regionauniquename"body"usingtheregion-nameattribute.Thisvalueisusedwith
flowelementstospecifywhichcontentgoesintowhichregiononthepage.
Figure4-5:
Themaster-layout
element
<layout-master-set>
<simple-page-master master-name="simple">
<region-body margin="2.5cm" region-name="body"
background-color="#eeeeee"/>
</simple-page-master>
</layout-master-set>
A FO file contains one or r more simple-page-master elements, each h with a unique
master-name. In this simple example we have only one. Each simple-page-master
elementcreatesaformattingobjectknownasapagemaster.
IbexPDFCreator
DevelopersGuide
IntroductiontoXSL-FO
13
AnexampleofamorecomplexdocumentistheIbexmanual.Eachchapterbeginswitha
pagewhichhasnoheader.Thisisfollowedbyapagewhichhasleft-alignedfooter,then
apagewitharight-alignedfooter.Eachofthethreepossiblepagelayoutsisdefinedbya
differentsimple-page-masterelement.
4.1.4 Thepage-sequenceelement
Thepage-sequenceelementshowninFigure4-6definesasequenceofpagesthatwill
appearinthePDFdocument.Themaster-referenceattributeisusedtotiethecontentof
thepage-sequencetoaparticularpagelayout,inthiscaseonedefinedpreviouslyusinga
simple-page-master. WhenIbexfindsapage-sequence elementitlooksatthelistof
known simple-page-master and page-sequence-master elements (we have no
page-sequence-masterelementsin this example)and findsone e with h amaster-name
attribute whichequalsthe master-reference attribute onthe page-sequence. IfIbex
doesnotfind amatching page master the FOfile isinvalid andIbex willthrow an
exception.
Figure4-6:
Thepage-sequence
element
<page-sequence master-reference="simple">
<flow flow-name="body">
<block>Hello World</block>
</flow>
</page-sequence>
Withinthe page-sequence element we have aflowelement. Thisholdsthe content
whichwillappearononeormorepages.Apagecanhavemultipleregions.Toassociate
contentwitharegionweusetheflow-nameattributeontheflowelement.Inorderfor
thecontentcontainedintheflowtoappearonthepage,theflow-nameoftheflow
shouldmatcharegion-nameofoneoftheregions(inthisexampletheregion-body)on
thepage.
Iftheflow-nameoftheflowdoesnotmatcharegion-nameofoneoftheregionsonthe
pagethecontentisnotdisplayedonthatpage.Thisisnotanerror.Itisausefulfeature
andweshowhowtouseitlaterinthischapter.
LookingattheFOinFigure4-7,theunderlinednamesmustmatcheachother,andthe
namesinitalicsshouldmatchifyouwantthecontenttoappear.
Figure4-7:
Matching
master-nameand
master-reference
<layout-master-set>
<simple-page-master master-name="simple">
<region-body margin="2.5cm" region-name="body"
background-color='#eeeeee'/>
</simple-page-master>
</layout-master-set>
<page-sequence master-reference="simple">
<flow flow-name="body">
<block>Hello World</block>
</flow>
</page-sequence>
Withintheflowelementwecanhaveoneormore"blocklevel"elements.Theseare
elementssuchaslist,blockandtablewhichdefinethecontenttoappearonthepage.In
thisexamplewehaveasingleblockelementcontainingthetext"HelloWorld".
IbexPDFCreator
DevelopersGuide
14
IntroductiontoXSL-FO
This produces a page like the one showninFigure 4-8. The e regioncreated d by the
region-bodyelementhasashadedbackgroundsoyoucanseehowlargeitis.
Figure4-8:
Abasicpagewitha
region-bodyandsome
text
4.2 Addingafooterregion
Inourexample sofarallthetextcontainedinthe flowelementgoesintothebody
regioninthecenterofthepage.Toaddapagefooterweneedtodefineanewregion
onthepageandthendefinesomenewcontenttogointothatregion.
We define a footer r region n by y adding g a region-after element t into the e existing
simple-page-masterasshowninFigure4-9.
Figure4-9:
Simplepagemaster
withfooterregion
<layout-master-set>
<simple-page-master master-name="simple">
...
<region-after extent='1cm' ' region-name="footer"
background-color='#dddddd'/>
...
</simple-page-master>
</layout-master-set>
Theregion-afterelementdefinesanareaonthepagewhichextendsthefullwidthofthe
page.Ifwehadsideregions(region-startandregion-end)thismightchange,butinthis
examplewehavenosideregions.
Theheightoftheregioncreatedbytheregion-afterelementisdefinedbytheextent
attribute.Inthisexamplewehaveextent="1cm",sotheregionwillbe1cmhighandend
atthebottomofthepage.
Documents you may be interested
Documents you may be interested