download pdf file in asp.net c# : Get pdf metadata SDK application service wpf html winforms dnn cpdfmanual2-part1393

Chapter 3
Pages
cpdf -scale-page "<scale x> <scale y>" in.pdf [<range>] -o out.pdf
cpdf -scale-to-fit "<x size> <y size>" [-scale-to-fit-scale <scale>]
in.pdf [<range>] -o out.pdf
cpdf -scale-contents [<scale>] [<position>] in.pdf [<range>] -o out.pdf
cpdf -shift "<shift x> <shift y>" in.pdf [<range>] -o out.pdf
cpdf -rotate <angle> in.pdf [<range>] -o out.pdf
cpdf -rotateby <angle> in.pdf [<range>] -o out.pdf
cpdf -rotate-contents <angle> in.pdf [<range>] -o out.pdf
cpdf -upright in.pdf [<range>] -o out.pdf
cpdf -hflip in.pdf [<range>] -o out.pdf
cpdf -vflip in.pdf [<range>] -o out.pdf
cpdf -mediabox "<x> <y> <w> <h>" in.pdf [<range>] -o out.pdf
cpdf -crop "<x> <y> <w> <h>" in.pdf [<range>] -o out.pdf
cpdf -remove-crop in.pdf [<range>] -o out.pdf
cpdf -frombox <boxname> -tobox <boxname> [-mediabox-if-missing]
in.pdf [<range>] -o out.pdf
3.1 PageSizes
Anytimewhenapagesizeisrequired,insteadofwriting,forinstance"210mm 197mm"one
caninsteadwritea4portrait.Hereisalistofsupportedpagesizes:
13
Get pdf metadata - add, remove, update PDF metadata in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Allow C# Developers to Read, Add, Edit, Update and Delete PDF Metadata
google search pdf metadata; view pdf metadata
Get pdf metadata - VB.NET PDF metadata library: add, remove, update PDF metadata in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Enable VB.NET Users to Read, Write, Edit, Delete and Update PDF Document Metadata
adding metadata to pdf files; change pdf metadata
14
CHAPTER3. PAGES
a0portrait
a1portrait
a2portrait
a3portrait
a4portrait
a5portrait
a6portrait
a7portrait
a8portrait
a9portrait
a10portrait
a0landscape
a1landscape
a2landscape
a3landscape
a4landscape
a5landscape
a6landscape
a7landscape
a8landscape
a9landscape
a10landscape
usletterportrait
usletterlandscape
uslegalportrait
uslegallandscape
3.2 ScalePages
The-scale-pageoperationscaleseachpageintherangebytheXandYfactorsgiven.This
scalesboththepagecontents,andthepagesizeitself.ItalsoscalesanyCropBoxandother
boxes(ArtBox,TrimBoxetc). Aswithseveralofthesecommands,remembertotakeinto
accountanypagerotationwhenconsideringwhattheXandYaxesrelateto.
cpdf -scale-page "2 2" in.pdf -o out.pdf
ConvertanA4pagetoA3,forinstance.
The-scale-to-fitoperationscaleseachpageintherangetofitagivenpagesize,preserving
aspectratioandcenteringtheresult.
cpdf -scale-to-fit "297mm 210mm" in.pdf -o out.pdf
cpdf -scale-to-fit a4portrait in.pdf -o out.pdf
Scaleafile’spagestofitA4portrait.
Thescalecanoptionallybesettoapercentageoftheavailablearea,insteadoffillingit.
cpdf -scale-to-fit a4portrait -scale-to-fit-scale 0.9 in.pdf -o out.pdf
Scaleafile’spagestofitA4portrait,scalingthepage90%ofitspossiblesize.
The-scale-contentsoperationscalesthecontentsaboutthecenterofthecropbox(or,if
absent,themediabox),leavingthepagedimensions(boxes)unchanged.
cpdf -scale-contents 0.5 in.pdf -o out.pdf
Scaleafile’scontentsonallpagesto50%ofitsoriginaldimensions.
C# TIFF: TIFF Metadata Editor, How to Write & Read TIFF Metadata
TIFFDocument doc = new TIFFDocument(@"c:\demo1.tif"); // Get Xmp metadata for string. TagCollection collection = doc.GetTagCollection(0); // Get Exif metadata.
pdf xmp metadata editor; change pdf metadata creation date
VB.NET PDF Annotate Library: Draw, edit PDF annotation, markups in
' Get PDF document. Dim fileInpath As String = "" Dim doc As PDFDocument = New PDFDocument(fileInpath) ' Get all annotations. ' Get PDF document.
edit pdf metadata online; pdf metadata
3.3. SHIFTPAGECONTENTS
15
Toscaleaboutapointotherthanthecenter,onecanusethepositioningcommandsdescribedin
Section8.2.4.Forexample:
cpdf -scale-contents 0.5 -topright 20 in.pdf -o out.pdf
Scaleafile’scontentsonallpagesto50%ofitsoriginaldimensionsaboutapoint20ptsfromitstop
rightcorner.
3.3 ShiftPageContents
The-shiftoperationshiftsthecontentsofeachpageintherangebyXpointshorizontally
andYpointsvertically.
cpdf -shift "50 0" in.pdf even -o out.pdf
Shiftpagestotherightby50points(forinstance,toincreasethebindingmargin).
3.4 RotatingPages
Therearetwowaysofrotatingpages:(1)settingavalueinthePDFfilewhichaskstheviewer
(e.g.Acrobat)torotatethepageon-the-flywhenviewingit(use-rotateor-rotateby)and
(2)actuallyrotatingthepagecontentsand/orthepagedimensions(use-uprightafterwards
or-rotate-contentstojustrotatethepagecontents).
Thepossiblevaluesfor-rotateand-rotate-byare0,90,180and270,allinterpretedas
beingclockwise.Anyvaluemaybeusedfor-rotate-contents.
The-rotateoperationsetstheviewingrotationoftheselectedpagestotheabsolutevalue
given.
cpdf -rotate 90 in.pdf -o out.pdf
Settherotationofallthepagesintheinputfiletoninetydegreesclockwise.
The-rotatebyoperationchangestheviewingrotationofallthegivenpagesbytherelative
valuegiven.
cpdf -rotateby 90 in.pdf -o out.pdf
Rotateallthepagesintheinputfilebyninetydegreesclockwise.
The-rotate-contentsoperationrotatesthecontentsanddimensionsofthepagebythe
givenrelativevalue.
C# PDF Annotate Library: Draw, edit PDF annotation, markups in C#.
Get PDF document. String fileInpath = @""; PDFDocument doc = new PDFDocument(fileInpath); // Get all annotations. Get PDF document.
pdf metadata online; add metadata to pdf file
How to C#: Modify Image Metadata (tag)
VB.NET How-to, VB.NET PDF, VB.NET Word, VB.NET Excel How to C#: Modify Image Metadata (tag). With XImage.Raster, you can get the image tags and modify them rapidly
batch pdf metadata; extract pdf metadata
16
CHAPTER3. PAGES
cpdf -rotate-contents 90 in.pdf -o out.pdf
Rotateallthepagecontentsintheinputfilebyninetydegreesclockwise.Doesnotchangethepage
dimensions.
The-uprightoperationdoeswhatevercombinationof-rotateand-rotate-contents
isrequiredtochangetherotationofthedocumenttozerowithoutalteringitsappearance.
3.5 FlippingPages
The-hflipand-vflipoperationsflipthecontentsofthechosenpageshorizontallyor
vertically.Noaccountistakenofthecurrentpagerotationwhenconsideringwhat”horizontally”
and”vertically”mean,soyoumayliketouse-uprightfirst.
cpdf -hflip in.pdf even -o out.pdf
Fliptheevenpagesinin.pdfhorizontally.
cpdf -vflip in.pdf -o out.pdf
Flipallthepagesinin.pdfvertically.
3.6 BoxesandCropping
AllPDFfilescontainamediaboxforeachpage,givingthedimensionsofthepaper.Tochange
thesedimensions(withoutalteringthepagecontentsinanyway),usethe-mediaboxoption.
cpdf -mediabox "0pt 0pt 500pt 500pt" in.pdf -o out.pdf
Setthemediaboxto500pointssquare.
Thefournumbersareminimumx,minimumy,width,height.xcoordinatesincreasetothe
right,ycoordinatesincreaseupwards.PDFfilecanalsooptionallycontainacropboxforeach
page,definingtowhatextentthepageiscroppedbeforebeingdisplayedorprinted.Acropbox
canbeset,changedandremoved,withoutaffectingtheunderlyingmediabox.Tosetorchange
thecropboxuse-crop.Toremoveanyexistingcropbox,use-remove-crop.
cpdf -crop "0pt 0pt 200mm 200mm" in.pdf -o out.pdf
Croppagestothebottomleft200-millimetersquareofthepage.
cpdf -remove-crop in.pdf -o out.pdf
Removecropping.
VB.NET PDF: Get Started with PDF Library
rotate PDF pages, C#.NET search text in PDF, C#.NET edit PDF bookmark, C#.NET edit PDF metadata, C#.NET VB.NET PDF: Get Started with .NET PDF Library Using VB.
edit multiple pdf metadata; remove pdf metadata
C# PDF Image Extract Library: Select, copy, paste PDF images in C#
Scan image to PDF, tiff and various image formats. Get image information, such as its location, zonal information, metadata, and so on.
read pdf metadata online; remove pdf metadata online
3.6. BOXESANDCROPPING
17
Notethatthecropboxisonlyobeyedinsomeviewers.
cpdf -frombox <boxname> -tobox <boxname> [-mediabox-if-missing]
in.pdf [<range>] -o out.pdf
Copythecontentsofoneboxtoanother.
Thisoperationcopiesthecontentsofonebox(Mediabox,Cropbox,Trimboxetc.)toanother.If
-mediabox-if-missingisadded,themediaboxwillbesubstitutedwhenthe’from’boxis
notsetforagivenpage.Forexample
cpdf -frombox /TrimBox -tobox /CropBox in.pdf -o out.pdf
copiestheTrimBoxofeachpagetotheCropBoxofeachpage. Thepossibleboxesare
/MediaBox,/CropBox,/BleedBox,/TrimBox,/ArtBox.
VB.NET PDF Image Extract Library: Select, copy, paste PDF images
Capture image from whole PDF based on special characteristics. Get image information, such as its location, zonal information, metadata, and so on.
remove metadata from pdf acrobat; edit pdf metadata
C# PDF Page Extract Library: copy, paste, cut PDF pages in C#.net
You can easily get pages from a PDF file, and then use these pages to create and output a new PDF file. Pages order will be retained.
pdf xmp metadata viewer; pdf metadata editor online
18
CHAPTER3. PAGES
C# PDF insert text Library: insert text into PDF content in C#.net
String inputFilePath = Program.RootPath + "\\" 1.pdf"; PDFDocument doc = new PDFDocument(inputFilePath); // get a text manager from the document object
read pdf metadata; view pdf metadata in explorer
Chapter 4
Encryption and Decryption
cpdf -encrypt <method> <owner> <user>
[-no-encrypt-metadata] <permissions> in.pdf -o out.pdf
cpdf -decrypt in.pdf owner=<owner password> -o out.pdf
4.1 Introduction
PDFfilescanbeencryptedusingvarioustypesofencryptionandattachingvariouspermissions
describingwhatsomeonecan dowithaparticulardocument(forinstance,printingitor
extractingcontent).Therearetwotypesofperson:
TheUsercandotothedocumentwhatisallowedinthepermissions.
TheOwner candoanything,includingalteringthepermissionsorremovingencryption
entirely.
Therearefivekindsofencryption:
 40-bitencryption(method40bit)inAcrobat3(PDF1.1)andabove
 128-bitencryption(method128bit)inAcrobat5(PDF1.4)andabove
 128-bitAESencryption(methodAES)inAcrobat7(PDF1.6)andabove
 256-bitAESencryption(methodAES256)inAcrobat9(PDF1.7)–thisisdeprecated–do
notusefornewdocuments
 256-bitAESencryption(methodAES256ISO)inPDF2.0
Allencryptionsupportsthesekindsofpermissions:
-no-edit
Cannotchangethedocument
-no-print
Cannotprintthedocument
-no-copy
Cannotselectorcopytextorgraphics
-no-annot
Cannotaddorchangeformfieldsorannotations
19
20
CHAPTER4. ENCRYPTIONANDDECRYPTION
Inaddition,128-bitencryption(Acrobat5andabove)andAESencryptionsupportsthese:
-no-forms
Cannoteditformfields
-no-extract
Cannotextracttextorgraphics
-no-assemble
Cannotmergefilesetc.
-no-hq-print
Cannotprinthigh-quality
Addtheseflagstothecommandlinetopreventeachoperation.
4.2 EncryptingaDocument
Toencryptadocument,theowneranduserpasswordsmustbegiven(here,fredandcharles
respectively):
cpdf -encrypt 40bit fred charles -no-print in.pdf -o out.pdf
cpdf -encrypt 128bit fred charles -no-extract in.pdf -o out.pdf
cpdf -encrypt AES fred "" -no-edit -no-copy in.pdf -o out.pdf
Ablankuserpasswordiscommon.Inthisevent,PDFviewerswilltypicallynotpromptfora
passwordforwhenopeningthefileorforoperationsallowablewiththeuserpassword.
cpdf -encrypt AES256 fred "" -no-forms in.pdf -o out.pdf
Inaddition,theusualmethodcanbeusedtogivetheexistingownerpassword,ifthedocument
isalreadyencrypted.
WhenusingAESencryption,theoptionisavailabletorefrainfromencryptingthemetadata.
Add-no-encrypt-metadatatothecommandline.
4.3 DecryptingaDocument
Todecryptadocument,theownerpasswordisprovided.
cpdf -decrypt in.pdf owner=fred -o out.pdf
Theuserpasswordcannotdecryptafile.
Chapter 5
Compression
cpdf -decompress in.pdf -o out.pdf
cpdf -compress in.pdf -o out.pdf
cpdfprovidesbasicfacilitiesfordecompressingandcompressingPDFstreams.
5.1 DecompressingaDocument
TodecompressthestreamsinaPDFfile,forinstancetomanuallyinspectthePDF,use:
cpdf -decompress in.pdf -o out.pdf
Ifcpdffindsacompressiontypeitcan’tcopewith,thestreamisleftcompressed.Whenusing
-decompress,objectstreamsarenotcompressed.
5.2 CompressingaDocument
TocompressthestreamsinaPDFfile,use:
cpdf -compress in.pdf -o out.pdf
cpdfcompressesanystreamswhichhavenocompressionusingtheFlateDecodemethod,with
theexceptionofMetadatastreams,whichareleftuncompressed.
21
22
CHAPTER5. COMPRESSION
Documents you may be interested
Documents you may be interested