pdf viewer in asp.net c# : How to add image to pdf control SDK utility azure wpf html visual studio cpdfmanual3-part640

Chapter 6
Bookmarks
cpdf -list-bookmarks [-utf8 | -raw] in.pdf
cpdf -remove-bookmarks in.pdf -o out.pdf
cpdf -add-bookmarks <bookmark file> in.pdf -o out.pdf
PDFBookmarks(properlycalledthedocumentoutline)representatreeofreferencestopartsof
thefile,typicallydisplayedatthesideofthescreen.Theusercanclickononetomovetothe
specifiedplace.cpdfprovidesfacilitiestolist,add,andremovebookmarks.Theformatused
bythelistandaddoperationsisthesame,soyoucanfeedtheoutputofoneintotheother,for
instancetocopybookmarks.
6.1 ListBookmarks
The-list-bookmarksoperationprints(tostandardoutput)thebookmarksinafile. The
firstcolumngivesthelevelofthetreeatwhichaparticularbookmarkis.Thenthetextofthe
bookmarkinquotes,thenthepagenumberwhichthebookmarkpointsto,then(optionally)the
word”open”ifthebookmarkshouldhaveitschildren(atthelevelimmediatelybelow)visible
whenthefileisloaded.Forexample,uponexecuting
cpdf -list-bookmarks doc.pdf
theresultmightbe:
0 "Part 1" 1 open
1 "Part 1A" 2
1 "Part 1B" 3
0 "Part 2" 4
1 "Part 2a" 5
23
How to add image to pdf - insert images into PDF in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Sample C# code to add image, picture, logo or digital photo into PDF document page using PDF page editor control
adding an image to a pdf in preview; add a jpeg to a pdf
How to add image to pdf - VB.NET PDF insert image library: insert images into PDF in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Guide VB.NET Programmers How to Add Images in PDF Document
add signature image to pdf; add jpeg signature to pdf
24
CHAPTER6. BOOKMARKS
Ifthepagenumberis0,itindicatesthatclickingonthatentrydoesn’tmovetoapage.
Bydefault,cpdfconvertsunicodetoASCIItext,droppingcharactersoutsidetheASCII
range.Topreventthis,andreturnunicodeUTF8output,addthe-utf8optiontothecommand.
Topreventanyprocessing,usethe-rawoption.
6.2 RemoveBookmarks
The-remove-bookmarksoperationsremovesallbookmarksfromthefile.
cpdf -remove-bookmarks in.pdf -o out.pdf
6.3 AddBookmarks
The-add-bookmarksfileaddsbookmarksasspecifiedbyabookmarksfile,atextfileinASCII
orUTF8encodingandinthesameformatasthatproducedbythe-list-bookmarksoption.
IfthereareanybookmarksintheinputPDFalready,theyarediscarded.Forexample,ifthefile
bookmarks.txtcontainstheoutputfrom-list-bookmarksabove,thenthecommand
cpdf -add-bookmarks bookmarks.txt in.pdf -o out.pdf
addsthebookmarkstotheinputfile,writingtoout.pdf. Anerrorwillbegivenifthe
bookmarksfileisnotinthecorrectform(inparticular,thenumbersinthefirstcolumnwhich
specifythelevelmustformapropertreewithnoentrybeingmorethanonegreaterthanthe
last).
C# PDF Image Extract Library: Select, copy, paste PDF images in C#
Get image information, such as its location, zonal information, metadata, and so on. Able to edit, add, delete, move, and output PDF document image.
adding an image to a pdf; add image pdf
VB.NET PDF Password Library: add, remove, edit PDF file password
VB: Add Password to PDF with Permission Settings Applied. This VB.NET example shows how to add PDF file password with access permission setting.
add image pdf document; adding images to a pdf document
Chapter 7
Presentations
cpdf -presentation in.pdf [<range>] -o out.pdf
[-trans <transition-name>] [-duration <float>]
[-vertical] [-outward] [-direction <int>]
[-effect-duration <float>]
ThePDFfileformat,startingatVersion1.1,providesforsimpleslide-showpresentationsin
themannerofMicrosoftPowerpoint.ThesecanbeplayedinAcrobatandpossiblyotherPDF
viewers,typicallystartedbyenteringfull-screenmode.The-presentationoperationallows
suchapresentationtobebuiltfromanyPDFfile.
The-transoptionchoosesthetransitionstyle. Whenapagerangeisused,itisthe
transitionfromeachpagenamedwhichisaltered.Thefollowingtransitionstylesareavailable:
Split Twolinessweepacrossthescreen,revealingthenewpage. Bydefaultthelinesare
horizontal.Verticallinesareselectedbyusingthe-verticaloption.
Blinds Multiplelinessweepacrossthescreen,revealingthenewpage.Bydefaultthelinesare
horizontal.Verticallinesareselectedbyusingthe-verticaloption.
Box Arectangularboxsweepsinwardfromtheedgesofthepage.Use-outwardtomakeit
sweepfromthecentertotheedges.
Wipe Asinglelinesweepsacrossthescreenfromoneedgetotheotherinadirectionspecified
bythe-directionoption.
Dissolve Theoldpagedissolvesgraduallytorevealthenewone.
Glitter ThesameasDissolvebuttheeffectsweepsacrossthepageinthedirectionspecifiedby
the-directionoption.
25
C# PDF Password Library: add, remove, edit PDF file password in C#
C# Sample Code: Add Password to PDF with Permission Settings Applied in C#.NET. This example shows how to add PDF file password with access permission setting.
how to add photo to pdf in preview; add jpg to pdf online
VB.NET PDF Image Extract Library: Select, copy, paste PDF images
DLLs for PDF Image Extraction in VB.NET. In order to run the sample code, the following steps would be necessary. Add necessary references:
adding an image to a pdf file; how to add image to pdf in acrobat
26
CHAPTER7. PRESENTATIONS
Toremoveatransitionstylecurrentlyappliedtotheselectedpages,omitthe-transoption.
The-effect-durationoptionspecifiesthelengthoftimeinsecondsforthetransition
itself.Thedefaultvalueisonesecond.
The-durationoptionspecifiesthemaximumtimeinsecondsthatthepageisdisplayed
beforethepresentationautomaticallyadvances.Thedefault,intheabsenceofthe-duration
option,isfornoautomaticadvancement.
The-directionoption(forWipeandGlitterstylesonly)specifiesthedirectionofthe
effect.Thefollowingvaluesarevalid:
0 Lefttoright
90 Bottomtotop(Wipeonly)
180 Righttoleft(Wipeonly)
270 Toptobottom
315 Top-lefttobottom-right(Glitteronly)
Forexample:
cpdf -presentation in.pdf 2-end -trans Split -duration 10 -o out.pdf
TheSplitstyle,withverticallines,andeachslidestayingtensecondsunlessmanuallyadvanced.
Thefirstpage(beingatitle)doesnotmoveonautomatically,andhasnotransitioneffect.
Tousedifferentoptionsondifferentpageranges,runcpdfmultipletimesonthefileusinga
differentpagerangeeachtime.
C# Create PDF from images Library to convert Jpeg, png images to
List<Bitmap> images = new List<Bitmap>(); images.Add(new Bitmap(Program.RootPath + "\\" 1.gif")); / Build a PDF document with GIF image.
add image to pdf online; how to add image to pdf acrobat
C# PDF Sticky Note Library: add, delete, update PDF note in C#.net
C#.NET PDF SDK - Add Sticky Note to PDF Page in C#.NET. Able to add notes to PDF using C# source code in Visual Studio .NET framework.
how to add image to pdf form; add jpg to pdf preview
Chapter 8
Watermarks and Stamps
cpdf -stamp-on source.pdf
([-scale-stamp-to-fit] | [<positioning command>])
in.pdf [<range>] -o out.pdf
cpdf -stamp-under source.pdf
([-scale-stamp-to-fit] | [<positioning command>])
in.pdf [<range>] -o out.pdf
cpdf -combine-pages over.pdf under.pdf -o out.pdf
cpdf -add-text <text-format>
[-font <fontname>]
[-font-size <size-in-points>]
[-color <color>]
[-line-spacing <number>]
[-outline]
[-linewidth <number>]
[-underneath]
[-relative-to-cropbox]
[-prerotate]
[-bates <number>]
[-opacity <number>]
in.pdf [<range>] -o out.pdf
Seealsopositioningcommandsbelow.
cpdf -remove-text in.pdf [<range>] -o out.pdf
8.1 AddaWatermarkorLogo
The-stamp-onand-stamp-underoperationsstampthefirstpageofasourcePDFontoor
undereachpageinthegivenrangeoftheinputfile.Forexample,
27
C# PDF remove image library: remove, delete images from PDF in C#.
C# Read: PDF Image Extract; C# Write: Insert text into PDF; C# Write: Add Image to PDF; Remove Image from PDF Page Using C#. Add necessary references:
add jpg to pdf file; add a jpeg to a pdf
VB.NET PDF remove image library: remove, delete images from PDF in
C# Read: PDF Image Extract; C# Write: Insert text into PDF; C# Write: Add Image to PDF; VB.NET: Remove Image from PDF Page. Add necessary references:
add a picture to a pdf; add jpg to pdf
28
CHAPTER8. WATERMARKSANDSTAMPS
cpdf -stamp-on logo.pdf in.pdf odd -o out.pdf
stampsthefilelogo.pdfontotheoddpagesofin.pdf,writingtoout.pdf.Awatermark
shouldgounderneatheachpage:
cpdf -stamp-under topsecret.pdf in.pdf -o out.pdf
ThepositioncommandsinSection8.2.4canbeusedtolocatethestampmoreprecisely(theyare
calculatedrelativetothecropboxofthestamp).Or,preprocessthestampwith-shiftfirst.
The-scale-stamp-to-fitoptioncanbeaddedtoscalethestamptofitthepagebefore
applyingit.Theuseofpositioningcommandstogetherwith-scale-stamp-to-fitisnot
recommended.
The-combine-pagesoperationtakestwoPDFfilesandstampseachpageofoneover
eachpageoftheother.Thelengthoftheoutputisthesameasthelengthofthe“under”file.
Forinstance:
cpdf -combine-pages over.pdf under.pdf -o out.pdf
Pageattributes(suchasthedisplayrotation)aretakenfromthe“under”file.Forbestresults,
removeanyrotationdifferencesinthetwofilesusing-uprightfirst.
8.2 StampText,DatesandTimes.
The-add-textoperationallowstext,datesandtimestobestampedoveroneormorepages
oftheinputatagivenpositionandusingagivenfont,fontsizeandcolor.
cpdf -add-text "Copyright 2014 ACME Corp." in.pdf -o out.pdf
Thedefaultisblack12ptTimesNewRomantextinthetopleftofeachpage.Thetextcanbe
placedunderneathratherthanoverthepagebyaddingthe-underneathoption.
Textpreviouslyaddedbycpdfmayberemovedbythe-remove-textoperation.
cpdf -remove-text in.pdf -o out.pdf
8.2.1 PageNumbers
Therearevariousspecialcodestoincludethepagenumberinthetext:
8.2. STAMPTEXT,DATESANDTIMES.
29
%Page
Pagenumberinarabicnotation(1,2,3...)
%roman
Pagenumberinlower-caseromannotation(i,ii,iii...)
%Roman
Pagenumberinupper-caseromannotation(I,II,III...)
%EndPage
Lastpageofdocumentinarabicnotation
%Label
Thepagelabelofthepage
%EndLabel
Thepagelabelofthelastpage
%filename
Thefullfilenameoftheinputdocument
Forexample,theformat"Page %Page of %EndPage"mightbecome”Page5of17”.
NB:Insomecircumstances(e.ginbatchfiles)onMicrosoftWindows,%isaspecialcharacter,
andmustbeescaped(writtenas%%).Consultyourlocaldocumentationfordetails.
8.2.2 DateandTimeFormats
%a
Abbreviatedweekdayname(Sun,Monetc.)
%A
Fullweekdayname(Sunday,Mondayetc.)
%b
Abbreviatedmonthname(Jan,Febetc.)
%B
Fullmonthname(January,Februaryetc.)
%d
Dayofthemonth(01–31)
%e
Dayofthemonth(1–31)
%H
Hourin24-hourclock(00–23)
%I
Hourin12-hourclock(01–12)
%j
Dayoftheyear(001–366)
%m
Monthoftheyear(01–12)
%M
Minuteofthehour(00–59)
%p
”a.m”or”p.m”
%S
Secondoftheminute(00–61)
%T
Sameas%H:%M:%S
%u
Weekday(1–7,1=Monday)
%w
Weekday(0–6,0=Monday)
%Y
Year(0000–9999)
%%
The%character.
8.2.3 BatesNumbers
Uniquepageidentifierscanbespecifiedbyputting%Batesintheformat.Thestartingpoint
canbesetwiththe-batesoption.Forexample:
cpdf -add-text "Page ID: %Bates" -bates 23745 in.pdf -o out.pdf
8.2.4 Position
Thepositionofthetextmaybespecifiedeitherinabsoluteterms:
30
CHAPTER8. WATERMARKSANDSTAMPS
-pos-center "200 200"
Positionthecenterofthebaselinetextat(200pt,200pt)
-pos-left "200 200"
Positiontheleftofthebaselineofthetextat(200pt,200pt)
-pos-right "200 200"
Positiontherightofthebaselineofthetextat(200pt,200pt)
Positionsrelativetocertaincommonpointscanbeset:
-top 10
Centerofbaseline10ptsdownfromthetopcenter
-topleft 10
Leftofbaseline10ptsdownandinfromtopleft
-topright 10
Rightofbaseline10ptsdownandleftfromtopright
-left 10
Leftofbaseline10ptsinfromcenterleft
-bottomleft 10
Leftofbaseline10ptsinandupfrombottomleft
-bottom 10
Centerofbaseline10ptsupfrombottomcenter
-bottomright 10
Rightofbaseline10ptsupandinfrombottomright
-right 10
Rightofbaseline10ptsinfromthecenterright
-diagonal
Diagonal,bottomlefttotopright,centeredonpage
-reverse-diagonal
Diagonal,toplefttobottomright,centeredonpage
-center
Centeredonpage
Noattemptismadetotakeaccountofthepagerotationwheninterpretingtheposition,so
-prerotatemustbeaddedtothecommandlineifthefilecontainspageswithanon-zero
viewingrotation.Thisisequivalenttopre-processingthedocumentwith-upright.
The-relative-to-cropboxmodifiercanbeaddedtothecommandlinetomakethese
measurementsrelativetothecropboxinsteadofthemediabox.
Thedefaultpositionisequivalentto-topleft 100.
The-midlineoptionmaybeaddedtospecifythatthepositioningcommandsaboveareto
beconsideredrelativetothemidlineofthetext,ratherthanitsbaseline.
8.2.5 FontandSize
Thefontmaybesetwiththe-fontoption.The14StandardPDFfontsareavailable:
8.2. STAMPTEXT,DATESANDTIMES.
31
Times-Roman
Times-Bold
Times-Italic
Times-BoldItalic
Helvetica
Helvetica-Bold
Helvetica-Oblique
Helvetica-BoldOblique
Courier
Courier-Bold
Courier-Oblique
Courier-BoldOblique
Symbol
ZapfDingbats
Forexample,pagenumbersinTimesItaliccanbeachievedby:
cpdf -add-text "-%Page-" -font "Times-Italic" in.pdf -o out.pdf
SeeSection14.1forhowtouseotherfonts.
Thefontsizecanbealteredwiththe-font-sizeoption,whichspecifiesthesizeinpoints:
cpdf -add-text "-%Page-" -font-size 36 in.pdf -o out.pdf
8.2.6 Colors
The-coloroptiontakesanRGBcolor,wherered,greenandbluecomponentsrangebetween
0and1.Thefollowingvaluesarepredefined:
Color R,G,B
white 1,1,1
black
0,0,0
red
1,0,0
green
0,1,0
blue
0,0,1
cpdf -add-text "Hullo" -color "red" in.pdf -o out.pdf
cpdf -add-text "Hullo" -color "0.5 0.5 0.5" in.pdf -o out.pdf
Partly-transparenttextmaybespecifiedusingthe-opacityoption.Whollyopaqueis1and
whollytransparentis0.Forexample:
cpdf -add-text "DRAFT" -color "red" -opacity 0.3 -o out.pdf
32
CHAPTER8. WATERMARKSANDSTAMPS
8.2.7 OutlineText
The-outlineoptionsetsoutlinetext. Thelinewidth(default1pt)maybesetwiththe
-linewidthoption.Forexample,tostampdocumentsasdrafts:
cpdf -add-text "DRAFT" -diagonal -outline in.pdf -o out.pdf
8.2.8 Multi-lineText
Thecodenncanbeincludedinthetextstringtomovetothenextline.Inthiscase,thevertical
positionreferstothebaselineofthefirstlineoftext(ifthepositionisatthetop,topleftortop
rightofthepage)orthebaselineofthelastlineoftext(ifthepositionisatthebottom,bottom
leftorbottomright).
cpdf -add-text "Specification\n%Page of %EndPage"
-topright 10 in.pdf -o out.pdf
The-midlineoptionmaybeusedtomaketheseverticalpositionsrelativetothemidlineofa
lineoftextratherthanthebaseline,asusual.
The-line-spacingoptioncanbeusedtoincreaseordecreasethelinespacing,wherea
spacingof1isthestandard.
cpdf -add-text "Specification\n%Page of %EndPage"
-topright 10 -line-spacing 1.5 in.pdf -o out.pdf
Justificationofmultiplelinesishandledbythe-justify-left,-justify-rightand
-justify-centeroptions.Thedefaultsareleftjustificationforpositionsrelativetotheleft
handsideofthepage,rightjustificationforthoserelativetotheright,andcenterjustification
forpositionsrelativetothecenterofthepage.Forexample:
cpdf -add-text "Long line\nShort" -justify-right
in.pdf -o out.pdf
8.2.9 SpecialCharacters
Ifyourcommandlineallowsfortheinclusionofunicodecharacters,theinputtextwillbe
consideredasUTF8bycpdf.SpecialcharacterswhichexistinthePDFWinAnsiEncodingLatin
Documents you may be interested
Documents you may be interested