c# display pdf in window : Add a page to a pdf document Library SDK component asp.net .net html mvc QGIS-2.2-UserGuide-en22-part480

CHAPTER
18
PrintComposer
ThePrintComposerprovidesgrowinglayoutandprintingcapabilities. Itallowsyoutoaddelementssuchas
theQGISmapcanvas,textlabels,images,legends,scalebars,basicshapes,arrows,attributetablesandHTML
frames.Youcansize,group,alignandpositioneachelementandadjustthepropertiestocreateyourlayout.The
layoutcanbeprintedorexportedtoimageformats,PostScript,PDFortoSVG(exporttoSVGisnotworking
properlywithsomerecentQt4versions;youshouldtryandcheckindividuallyonyoursystem).Youcansavethe
layoutasatemplateandloaditagaininanothersession.Finally,generatingseveralmapsbasedonatemplatecan
bedonethroughtheatlasgenerator.Seealistoftoolsintable_composer_1:
215
Add a page to a pdf document - insert pages into PDF file in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Guide C# Users to Insert (Empty) PDF Page or Pages from a Supported File Format
add or remove pages from pdf; add page number pdf
Add a page to a pdf document - VB.NET PDF Page Insert Library: insert pages into PDF file in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Easy to Use VB.NET APIs to Add a New Blank Page to PDF Document
add page to pdf preview; add a page to a pdf in reader
QGISUserGuide,Release2.2
Icon
Purpose
Icon
Purpose
SaveProject
NewComposer
DuplicateComposer
ComposerManager
Loadfromtemplate
Saveastemplate
PrintorexportasPostScript
Exporttoanimageformat
ExportprintcompositiontoSVG
ExportasPDF
Revertlastchange
Restorelastchange
Zoomtofullextent
Zoomto100%
Zoomin
Zoomout
RefreshView
Pan
Zoomtospecificregion
Select/Moveiteminprintcomposition
Movecontentwithinanitem
AddnewmapfromQGISmapcanvas
Addimagetoprintcomposition
Addlabeltoprintcomposition
Addnewlegendtoprintcomposition
Addscalebartoprintcomposition
Addbasicshapetoprintcomposition
Addarrowtoprintcomposition
Addattributetabletoprintcomposition
AddanHTMLframe
Groupitemsofprintcomposition
Ungroupitemsofprintcomposition
LockSelectedItems
UnlockAllitems
Raiseselecteditems
Lowerselecteditems
Moveselecteditemstotop
Moveselecteditemstobottom
Alignselecteditemsleft
Alignselecteditemsright
Alignselecteditemscenter
Alignselecteditemscentervertical
Alignselecteditemstop
Alignselecteditemsbottom
PreviewAtlas
FirstFeature
PreviousFeature
NextFeature
Lastfeature
PrintAtlas
ExportAtlasasImage
AtlasSettings
TableComposer1:PrintComposerTools
AllPrintComposertoolsareavailableinmenusandasiconsinatoolbar.Thetoolbarcanbeswitchedoffandon
usingtherightmousebuttonoverthetoolbar.
18.1 Firststeps
18.1.1 OpenanewPrintComposerTemplate
BeforeyoustarttoworkwiththePrintComposer,youneedtoloadsomerasterandvectorlayersintheQGIS
mapcanvasandadapttheirpropertiestosuityourownconvenience.Aftereverythingisrenderedandsymbolized
toyourliking,clickthe
NewPrintComposer
iconinthetoolbarorchooseFileNewPrintComposer. Youwill
216
Chapter18. PrintComposer
VB.NET PDF insert image library: insert images into PDF in vb.net
VB.NET PDF - Add Image to PDF Page in VB.NET. Guide VB.NET Programmers How to Add Images in PDF Document Using XDoc.PDF SDK for VB.NET.
adding a page to a pdf document; add a page to pdf file
C# PDF insert image Library: insert images into PDF in C#.net, ASP
How to insert and add image, picture, digital photo, scanned signature or logo into PDF document page in C#.NET class application?
adding page numbers to a pdf in reader; adding page numbers to a pdf document
QGISUserGuide,Release2.2
bepromptedtochooseatitleforthenewComposer.
18.1.2 UsingPrintComposer
OpeningthePrintComposerprovidesyouwithablankcanvastowhichyoucanaddthecurrentQGISmap
canvas,textlabels,images,legends,scalebars,basicshapes,arrows,attributetablesandHTMLframes. Fig-
ure_composer_1showstheinitialviewofthePrintComposerbeforeanyelementsareadded.
Figure18.1:PrintComposer
ThePrintComposerprovidesfourtabs:
• TheCompositiontaballowsyoutosetpapersize,orientation,thepagebackground,numberofpagesand
printqualityfortheoutputfileindpi.Furthermore,youcanalsoactivatethe
Printasrastercheckbox.
ThismeansallelementswillberasteredbeforeprintingorsavingasPostScriptorPDF.Inthistab,youcan
alsocustomizesettingsforgridandsmartguides.
• TheItemPropertiestabdisplaysthepropertiesfortheselecteditemelement. Clickthe
Select/Moveitem
icontoselectanelement(e.g.,legend,scalebarorlabel)onthecanvas.ThenclicktheItemPropertiestab
andcustomizethesettingsfortheselectedelement.
• TheCommandhistorytab(hiddenbydefault)displaysahistoryofallchangesappliedtothePrintComposer
layout.Withamouseclick,itispossibletoundoandredolayoutstepsbackandforthtoacertainstatus.
• TheAtlasgenerationtaballowsyoutoenablethegenerationofanatlasforthecurrentComposerandgives
accesstoitsparameters.
InthebottompartofthePrintComposerwindow,youcanfindastatusbarwithmouseposition,currentpage
numberandacomboboxtosetthezoomlevel.
YoucanaddmultipleelementstotheComposer.Itisalsopossibletohavemorethanonemapvieworlegendor
scalebarinthePrintComposercanvas,ononeorseveralpages. Eachelementhasitsownpropertiesand,inthe
18.1. Firststeps
217
C# PDF Password Library: add, remove, edit PDF file password in C#
your PDF document in C# project, XDoc.PDF provides some PDF security settings. On this page, we will talk about how to achieve this via Add necessary references
add document to pdf pages; add page to pdf
VB.NET PDF Page Extract Library: copy, paste, cut PDF pages in vb.
This .NET PDF Document Add-On integrates mature PDF document page processing functions, including extracting one or more page(s) from PDF document.
add pages to pdf online; adding page numbers to pdf in reader
QGISUserGuide,Release2.2
caseofthemap,itsownextent. IfyouwanttoremoveanyelementsfromtheComposercanvasyoucandothat
withtheDeleteortheBackspacekey.
Navigationtools
Tonavigateinthecanvaslayout,thePrintComposerprovidessomegeneraltools:
Zoomin
Zoomout
Zoomtofullextent
Zoomto100%
Refreshtheview
(ifyoufindtheviewinaninconsistentstate)
Pancomposer
Marqueezoommode
(zoomtoaspecificregionoftheComposer)
Youcanchangethezoomlevelalsousingthemousewheelorthecomboboxinthestatusbar.Ifyouneedtoswitch
topanmodewhileworkingintheComposerarea,youcanholdtheSpacebarorthethemousewheel. With
Ctrl+Spacebar,youcantemporarilyswitchtomarqueezoommode,andwithCtrl+Shift+Spacebar,
tozoomoutmode.
18.1.3 PrintComposerOptions
FromSettingsComposerOptionsyoucansetsomeoptionsthatwillbeusedasdefaultduringyourwork.
• Compositionsdefaultsletyouspecifythedefaultfonttouse.
• WithGridappearance,youcansetthegridstyleanditscolor.
• Griddefaultsdefinesspacing,offsetandtoleranceofthegrid. . Therearethreetypesofgrid:Dots,Solid
linesandCrosses.
• Guidedefaultsdefinesthetolerancefortheguides.
18.1.4 Compositiontab—Generalcompositionsetup
IntheCompositiontab,youcandefinetheglobalsettingsofyourcomposition.
• YoucanchooseoneofthePresetsforyourpapersheet,orenteryourcustomwidthandheight.
• Compositioncannowbedividedintoseveralpages.Forinstance,afirstpagecanshowamapcanvas,and
asecondpagecanshowtheattributetableassociatedwithalayer,whileathirdoneshowsanHTMLframe
linkingtoyourorganizationwebsite. SettheNumberofpagestothedesiredvalue. . Youcanchoosethe
pageOrientationanditsExportedresolution.Whenchecked,
printasrastermeansallelementswillbe
rasterizedbeforeprintingorsavingasPostScriptorPDF.
• Gridletsyoucustomizegridsettingslikespacings,offsetsandtolerancetoyourneed.
• InSnaptoalignments,youcanchangetheTolerance,whichisthemaximumdistancebelowwhichanitem
issnappedtosmartguides.
Snaptogridand/ortosmartguidescanbeenabledfromtheViewmenu.Inthismenu,youcanalsohideorshow
thegridandsmartguides.
218
Chapter18. PrintComposer
VB.NET PDF Password Library: add, remove, edit PDF file password
On this page, we will illustrate how to protect PDF document via password by using simple VB.NET demo code. Open password protected PDF. Add password to PDF.
add and delete pages from pdf; adding page numbers to pdf document
C# PDF File & Page Process Library SDK for C#.net, ASP.NET, MVC
Insert Image to PDF. Image: Remove Image from PDF Page. Image: Copy, Paste, Cut Image in Page. Link: Edit Images. Redact Pages. Annotation & Drawing. Add Sticky
add page to pdf online; adding a page to a pdf in preview
QGISUserGuide,Release2.2
18.1.5 Composeritemsgeneraloptions
ComposeritemshaveasetofcommonpropertiesyouwillfindonthebottomoftheItemPropertiestab:Position
andsize,Frame,Background,ItemIDandRendering(Seefigure_composer_2).
Figure18.2:CommonItempropertiesDialogs
• ThePositionandsizedialogletsyoudefinesizeandpositionoftheframethatcontainstheitem. . Youcan
alsochoosewhichReferencepointwillbesetattheXandYcoordinatespreviouslydefined.
• TheRotationsetstherotationoftheelement(indegrees).
• The
Frameshowsorhidestheframearoundthelabel.Clickonthe[Color]and[Thickness]buttonsto
adjustthoseproperties.
• The
Backgroundenablesordisablesabackgroundcolor. Clickonthe[Color...] buttontodisplaya
dialogwhereyoucanpickacolororchoosefromacustomsetting. Transparencycanalsobeadjusted
throughtthealphafield.
• UsetheItemIDtocreatearelationshiptootherPrintComposeritems.ThisisusedwithQGISserverand
anypotentialwebclient.YoucansetanIDonanitem(e.g.,amapandalabel),andthenthewebclientcan
senddatatosetaproperty(e.g.,labeltext)forthatspecificitem.TheGetProjectSettingscommandwilllist
whatitemsandwhichIDsareavailableinalayout.
• Renderingmodecanbeselectedintheoptionfield.SeeRendering_Mode.
18.2 Renderingmode
QGISnowallowsadvancedrenderingforComposeritemsjustlikevectorandrasterlayers.
Figure18.3:Renderingmode
18.2. Renderingmode
219
VB.NET PDF Page Delete Library: remove PDF pages in vb.net, ASP.
DLLs for Deleting Page from PDF Document in VB.NET Class. In order to run the sample code, the following steps would be necessary. Add necessary references:
add pages to pdf preview; add page to existing pdf file
C# PDF Page Extract Library: copy, paste, cut PDF pages in C#.net
pageIndexes.Add(3); // The 4th page. String outputFilePath = Program.RootPath + "\\" Output.pdf"; newDoc.Save(outputFilePath);
add page number to pdf; add page numbers to a pdf
QGISUserGuide,Release2.2
• Transparency
: YoucanmaketheunderlyingitemintheComposervisiblewiththis
tool.Usetheslidertoadaptthevisibilityofyouritemtoyourneeds.Youcanalsomakeaprecisedefinition
ofthepercentageofvisibilityinthethemenubesidetheslider.
• Blendingmode: Youcanachievespecialrenderingeffectswiththesetoolsthatyoupreviouslyonlymay
knowfromgraphicsprograms.Thepixelsofyouroverlayingandunderlayingitemsaremixedthroughthe
settingsdescribedbelow.
– Normal:Thisisthestandardblendmode,whichusesthealphachannelofthetoppixeltoblendwith
thepixelbeneathit;thecolorsaren’tmixed.
– Lighten:Thisselectsthemaximumofeachcomponentfromtheforegroundandbackgroundpixels.
Beawarethattheresultstendtobejaggedandharsh.
– Screen:Lightpixelsfromthesourcearepaintedoverthedestination,whiledarkpixelsarenot.This
modeismostusefulformixingthetextureofonelayerwithanotherlayer(e.g.,youcanuseahillshade
totextureanotherlayer).
– Dodge:Dodgewillbrightenandsaturateunderlyingpixelsbasedonthelightnessofthetoppixel.So,
brightertoppixelscausethesaturationandbrightnessoftheunderlyingpixelstoincrease.Thisworks
bestifthetoppixelsaren’ttoobright;otherwisetheeffectistooextreme.
– Addition:Thisblendmodesimplyaddspixelvaluesofonelayerwithpixelvaluesoftheother.Incase
ofvaluesabove1(asinthecaseofRGB),whiteisdisplayed. Thismodeissuitableforhighlighting
features.
– Darken: : Thiscreatesaresultantpixelthatretainsthesmallestcomponentsoftheforegroundand
backgroundpixels.Likelighten,theresultstendtobejaggedandharsh.
– Multiply:Here,thenumbersforeachpixelofthetoplayeraremultipliedwiththenumbersforthe
correspondingpixelofthebottomlayer.Theresultsaredarkerpictures.
– Burn:Darkercolorsinthetoplayercausetheunderlyinglayerstodarken.Burncanbeusedtotweak
andcoloriseunderlyinglayers.
– Overlay:Thismodecombinesthemultiplyandscreenblendingmodes.Intheresultingpicture,light
partsbecomelighteranddarkpartsbecomedarker.
– Softlight:Thisisverysimilartooverlay,butinsteadofusingmultiply/screenitusescolorburn/dodge.
Thismodeissupposedtoemulateshiningasoftlightontoanimage.
– Hardlight:Hardlightisverysimilartotheoverlaymode.It’ssupposedtoemulateprojectingavery
intenselightontoanimage.
– Difference: : Differencesubtractsthetoppixelfrom m thebottom pixel, ortheotherwayaround,to
alwaysgetapositivevalue.Blendingwithblackproducesnochange,asthedifferencewithallcolors
iszero.
– Subtract:Thisblendmodesimplysubtractspixelvaluesofonelayerwithpixelvaluesoftheother.In
caseofnegativevalues,blackisdisplayed.
18.3 ComposerItems
18.3.1 AddingacurrentQGISmapcanvastothePrintComposer
Clickonthe
Addnewmap
toolbarbuttoninthePrintComposertoolbartoaddtheQGISmapcanvas.Now,drag
arectangleontotheComposercanvaswiththeleftmousebuttontoaddthemap.Todisplaythecurrentmap,you
canchoosebetweenthreedifferentmodesinthemapItemPropertiestab:
• Rectangleisthedefaultsetting.Itonlydisplaysanemptyboxwithamessage‘Mapwillbeprintedhere’.
• Cacherendersthemapinthecurrentscreenresolution. . IfyouzoomtheComposerwindowinorout,the
mapisnotrenderedagainbuttheimagewillbescaled.
220
Chapter18. PrintComposer
QGISUserGuide,Release2.2
• RendermeansthatifyouzoomtheComposerwindowinorout,themapwillberenderedagain,butfor
spacereasons,onlyuptoamaximumresolution.
CacheisthedefaultpreviewmodefornewlyaddedPrintComposermaps.
Youcanresizethemapelementbyclickingonthe
Select/Moveitem
button,selectingtheelement,anddragging
oneofthebluehandlesinthecornerofthemap.Withthemapselected,youcannowadaptmorepropertiesinthe
mapItemPropertiestab.
Tomovelayerswithinthemapelement,selectthemapelement,clickthe
Moveitemcontent
iconandmovethe
layerswithinthemapelementframewiththeleftmousebutton. Afteryouhavefoundtherightplaceforan
element,youcanlocktheelementpositionwithinthePrintComposercanvas. Selectthemapelementandclick
ontherightmousebuttonto
Lock
theelementpositionandagaintounlocktheelement.Youcanalsolockthe
mapelementbyactivatingthe
LocklayersformapitemcheckboxintheMapdialogoftheItemProperties
tab.
Mainproperties
The Main properties dialog of the map Item Properies tab provides s the following functionalities (see fig-
ure_composer_4):
Figure18.4:MapItempropertiesTab
• ThePreviewareaallowsyoutodefinethepreviewmodes‘Rectangle’,‘Cache’and‘Render’,asdescribed
above. IfyouchangetheviewontheQGISmapcanvasbychangingvectororrasterproperties,youcan
updatethePrintComposerviewbyselectingthe mapelementinthePrintComposerandclickingthe
[Updatepreview]button.
• ThefieldScale
setsamanualscale.
18.3. ComposerItems
221
QGISUserGuide,Release2.2
• ThefieldRotation
allowsyoutorotatethemapelementcontentclockwiseindegrees. Notethata
coordinateframecanonlybeaddedwiththedefaultvalue0.
Drawmapcanvasitemsletsyoushowannotationsthatmaybeplacedonthemapcanvasinthemain
QGISwindow.
• Youcanchoosetolockthelayersshownonamapitem. . Check
Locklayersformapitem.Afterthisis
checked,anylayerthatwouldbedisplayedorhiddeninthemainQGISwindowwon’tappearorbehidden
inthemapitemoftheComposer.Butstyleandlabelsofalockedlayerarestillrefreshedaccordingtothe
mainQGISinterface.
Extents
TheExtentsdialogofthemapitemtabprovidesthefollowingfunctionalities(seefigure_composer_5):
Figure18.5:MapExtentsDialog
• TheMapextentareaallowsyoutospecifythemapextentusingYandXmin/maxvaluesorbyclicking
the[Settomapcanvasextent]button.
IfyouchangetheviewontheQGISmapcanvasbychangingvectororrasterproperties,youcanupdatethePrint
ComposerviewbyselectingthemapelementinthePrintComposerandclickingthe[Updatepreview]buttonin
themapItemPropertiestab(seefigure_composer_2).
Grid
TheGriddialogofthemapItemPropertiestabprovidesthefollowingfunctionalities(seeFigure_composer_6):
• The
Showgridcheckboxallowsyoutooverlayagridontothemapelement. Asgridtype,youcan
specifytouseasolidlineorcross. Symbologyofthegridcanbechosen. . SeesectionRendering_Mode.
Furthermore,youcandefineanintervalintheXandYdirections,anXandYoffset,andthewidthusedfor
thecrossorlinegridtype.
• Youcanchoosetopainttheframewithazebrastyle.Ifnotselected,thegeneralframeoptionisused(see
sectionFrame_dialog).Advancedrenderingmodeisalsoavailableforgrids(seesectionRendering_mode).
• The
Drawcoordinatescheckboxallowsyoutoaddcoordinatestothemapframe. Theannotationcan
bedrawninsideoroutsidethemapframe. Theannotationdirectioncanbedefinedashorizontal,vertical,
horizontalandvertical,orboundarydirection,foreachborderindividually. Unitscanbeinmetersorin
degrees. Finally,youcandefinethegridcolor,theannotationfont,theannotationdistancefromthemap
frameandtheprecisionofthedrawncoordinates.
Overview
The Overview dialog of the map Item Properties tab b provides s the e following functionalities s (see Fig-
ure_composer_7):
222
Chapter18. PrintComposer
QGISUserGuide,Release2.2
Figure18.6:MapGridDialog
Figure18.7:MapOverviewDialog
18.3. ComposerItems
223
QGISUserGuide,Release2.2
IftheComposerhasmorethanonemap,youcanchoosetouseafirstmaptoshowtheextentsofasecondmap.
TheOverviewdialogofthemapItemPropertiestaballowsyoutocustomizetheappearanceofthatfeature.
• TheOverviewframecombolistreferencesthemapitemwhoseextentswillbedrawnonthepresentmap
item.
• TheOverviewStyleallowsyoutochangetheframecolor.Seesectionvector_style_manager.
• TheOverviewBlendmodeallowsyoutosetdifferenttransparencyblendmodes,toenhancevisibilityofthe
frame.SeeRendering_Mode.
• Ifchecked,
Invertoverviewcreatesamaskaroundtheextents: thereferencedmapextentsareshown
clearly,whereaseverythingelseisblendedwiththeframecolor.
18.3.2 AddingaLabelitemtothePrintComposer
Toaddalabel,clickthe
Addlabel
icon,placetheelementwiththeleftmousebuttononthePrintComposer
canvasandpositionandcustomizeitsappearanceinthelabelItemPropertiestab.
TheItemPropertiestabofalabelitemprovidesthefollowingfunctionalities:
Figure18.8:LabelItempropertiesTab
Mainproperties
TheMainproperties dialog ofthelabel ItemProperties tabprovides s the followingfunctionalities (see Fig-
ure_composer_9):
• Themainpropertiesdialogiswherethetext(HTMLornot)ortheexpressionneededtofillthelabelis
addedtotheComposercanvas.
• Labels s canbeinterpretedasHTMLcode: : check
RenderasHTML. YoucannowinsertaURL, a
clickableimagethatlinkstoawebpageorsomethingmorecomplex.
• Youcanalsoinsertanexpression. . Clickon[Insertanexpression]toopenanewdialog. Buildanex-
pressionbyclickingthefunctionsavailableintheleftsideofthepanel. OntherightsideoftheInsertan
expressiondialog,thehelpfileassociatedwiththefunctionselectedisdisplayed. Twospecialcategories
canbeuseful,particularlyassociatedwiththeatlasfunctionality:geometryfunctionsandrecordsfunctions.
Atthebottom,apreviewoftheexpressionisshown.
• Definefontandfontcolorbyclickingonthe[Font]and[Fontcolor...]buttons.
224
Chapter18. PrintComposer
Documents you may be interested
Documents you may be interested