c# pdf reader writer : Add or remove pages from pdf software application project winforms html windows UWP TeXbyTopic16-part917

Chapter15. BaselineDistances
shouldbelarger(see[52]foradiscussionofthis),stripsofleadwouldbeinserted.The
extradistancewascalledthe‘leading’(pronounced‘ledding’).
Withphototypesetting,whenthebaselinedistancewassometimescalledthe‘filmtrans-
port’,thisterminologyblurred,andtheterm‘leading’wasalsousedforthebaselinedi-
stance.SomeofthisconfusionisalsopresentinT
E
X:theparameter\baselineskipspeci-
fiesthebaselinedistance,butinthetraceoutput(seetheexamplesabove)theglueinserted
tomakethebaselinedistanceequalto\baselineskipiscalled\baselineskip.
15.4 Additionalremarks
Ingeneral,fordocumentslongerthanonepageitisdesirabletohavethesamebaseline
distancethroughout.However,forone-pagedocumentsyoumayaddstretchabilitytothe
baselineskip,forinstanceifthetexthastobeflushbottom.
Increasingthedistancebetweenjustonepairoflinescanbedonewith\vadjust.The
argumentofthiscommandisverticalmaterialthatwillbeinsertedintheverticallistright
afterthelinewherethiscommandwasgiven.Thesecondlineofthisparagraph,forin-
stance,containsthecommand\vadjust{\kern2pt}.
Theamountofleadingcannotbechangedinthemiddleofaparagraph,becausetheva-
luefor\baselineskipthatisusedistheonethatiscurrentwhentheparagraphisfi-
nallybrokenandaddedtothemainverticallist.Thesameholdsforthe\lineskipand
\lineskiplimit.
TheplainT
E
Xmacro\openupincreasesthe\baselineskip,\lineskip,and\lineskiplimit
bytheamountoftheargumenttothemacro.Ineffect,thisincreaseslinedistancesbythis
amountregardlessofwhethertheyaregovernedby\baselineskipor\lineskip.
160
VictorEijkhout–T
E
XbyTopic
Add or remove pages from pdf - remove PDF pages in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Provides Users with Mature Document Manipulating Function for Deleting PDF Pages
delete a page from a pdf in preview; delete page pdf
Add or remove pages from pdf - VB.NET PDF Page Delete Library: remove PDF pages in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Visual Basic Sample Codes to Delete PDF Document Page in .NET
delete pages from pdf file online; delete blank page from pdf
Chapter16
ParagraphStart
AtthestartofaparagraphT
E
Xinsertsaverticalskipasaseparationfromthepreceding
paragraph,andahorizontalskipasanindentationforthecurrentparagraph.Thischapter
explainstheexactsequenceofactions,anditdiscusseshowT
E
X’sdecisionscanbealtered.
\indent Switchtohorizontalmodeandinsertaboxofwidth\parindent.
\noindent Switchtohorizontalmodewithanemptyhorizontallist.
\parskip Amountofglueaddedtothesurroundingverticallistwhenaparagraphstarts.
PlainT
E
Xdefault:0pt plus 1pt.
\parindent Sizeoftheindentationboxaddedinfrontofaparagraph.PlainT
E
Xdefault:20pt.
\everypar Tokenlistinsertedinfrontofparagraphtext;
\leavevmode Macrotoswitchtohorizontalmodeifnecessary.
16.1 Whendoesaparagraphstart
T
E
Xstartsaparagraphwheneveritswitchesfromverticalmodeto(unrestricted)horizontal
mode.Thisswitchcanbeeffectedbyoneofthecommands\indentand\noindent,for
example
{\bf And now~\dots}
\vskip3pt
\noindent It’s~\dots
orbyanyhorizontalcommand.Horizontalcommandsincludecharacters,in-lineformu-
las,andhorizontalskips,butnotboxes.Considerthefollowingexamples.Thecharacter‘I’
isahorizontalcommand:
\vskip3pt
It’s~\dots
Asingle$isahorizontalcommand:
$x$ is supposed~\dots
Thecontrolsequence\hskipisahorizontalcommand:
\hskip .5\hsize Long indentation~\dots
161
VB.NET PDF Password Library: add, remove, edit PDF file password
manipulations. Open password protected PDF. Add password to PDF. Change PDF original password. Remove password from PDF. Set PDF security level. VB
delete a page from a pdf without acrobat; delete pages from a pdf document
C# PDF Password Library: add, remove, edit PDF file password in C#
String outputFilePath = Program.RootPath + "\\" Output.pdf"; // Remove the password. doc.Save(outputFilePath); C# Sample Code: Add Password to Plain PDF
delete page from pdf reader; copy pages from pdf to word
Chapter16. ParagraphStart
Thefulllistofhorizontalcommandsisgivenonpage74.
Uponrecognizingahorizontalcommandinverticalmode,T
E
Xwillperforman\indent
command(andalltheactionsassociatedwithit;seebelow),andafterthatitwillreexamine
thehorizontalcommand,thistimeexecutingit.
16.2 Whathappenswhenaparagraphstarts
The\indentand\noindentcommandscauseaparagraphtobestarted.An \indent
commandcaneitherbeplacedexplicitlybytheuseroramacro,oritcanbeinsertedby
T
E
Xwhenahorizontalcommandoccursinverticalmode;a\noindentcommandcan
onlybeplacedexplicitly.
Aftereithercommandisencountered,\parskipglueisappendedtothesurroundingver-
ticallistunlessT
E
Xisininternalverticalmodeandthatlistisempty(forexample,atthe
start of a\vboxor\vtop).T
E
Xthenswitchesto unrestrictedhorizontalmodewith an
emptyhorizontallist.Inthecaseof\indent(whichmaybeinsertedimplicitly)anempty
\hboxofwidth\parindentisplacedatthestartofthehorizontallist;after\noindent
noindentationboxisinserted.
Thecontentsofthe\everypartokenparameterarethen inserted into theinput (see
someapplicationsbelow).Afterthat,thepagebuilderisexercised(seeChapter27).Note
thatthishappensinhorizontalmode:thisistomovethe\parskipgluetothecurrentpage.
Ifan\indentcommandisgivenwhileT
E
Xisalreadyinhorizontalmode,theindentation
boxisinsertedjustthesame.Thisisnotveryuseful.
16.3 Assortedremarks
16.3.1 Startingaparagraphwithabox
An\hboxdoesnotimplyhorizontalmode,soanattempttostartaparagraphwithabox,
forinstance
\hbox to 0cm{\hss$\bullet$\hskip1em}Text ....
willmakethetextfollowingthebox wind uponelinebelowthebox.It isnecessaryto
switchtohorizontalmodeexplicitly,usingforinstance\noindentor\leavevmode.The
latterisdefinedusing\unhbox,whichisahorizontalcommand.
16.3.2 Startingaparagraphwithagroup
Ifthefirsthorizontalcommandofaparagraphisenclosedinbraces,the\everyparis
evaluatedinsidethegroup.Thismaygiveunexpectedresults.Considerthisexample:
\everypar={\setbox0=\vbox\bgroup\def\par{\egroup}}
{\bf Start} a paragraph ... \par
Thehorizontalcommandstartingtheparagraphisthecharacter‘S’,sowhen\everypar
hasbeeninsertedtheinputisessentially
162
VictorEijkhout–T
E
XbyTopic
C# PDF Digital Signature Library: add, remove, update PDF digital
Image: Insert Image to PDF. Image: Remove Image from Redact Text Content. Redact Images. Redact Pages. Annotation & Highlight Text. Add Text. Add Text Box. Drawing
delete pages from pdf; copy pages from pdf to another pdf
C# PDF remove image library: remove, delete images from PDF in C#.
Image: Insert Image to PDF. Image: Remove Image from Redact Text Content. Redact Images. Redact Pages. Annotation & Highlight Text. Add Text. Add Text Box. Drawing
delete pdf pages in preview; delete pages from pdf without acrobat
16.4. Examples
{\bf \indent\setbox0=\vbox\bgroup
\def\par{\egroup}Start} a paragraph ... \par
whichisequivalentto
{\bf \setbox0=\vbox{Start} a paragraph ... \par
Theeffectofthisisratherdifferentfromwhatwasintended.Also,T
E
Xwillprobablyend
thejobinsideagroup.
16.4 Examples
16.4.1 Stretchableindentation
Consideringthat\parindentisadimen,notaglue,itisnotpossibletodeclare
\parindent=1cm plus 1fil
inordertogetavariableindentationatthestartofaparagraph.Thisproblemmaybesolved
byputting
\everypar={\nobreak\hskip 1cm plus 1fil\relax}
The\nobreakservestoprevent(inrarecases)alinebreakatthestretchableglue.
16.4.2 Suppressingindentation
Inserting{\setbox0=\lastbox}inthehorizontallistatthebeginningoftheparagraph
removestheindentation:indentationconsistsofabox,whichisavailablethrough\lastbox.
Assigningiteffectivelyremovesitfromthelist.
However,thiscommandsequencehastobeinsertedatamomentwhenT
E
Xhasalready
switchedtohorizontalmode,soexplicitinsertionofthesecommandsinfrontofthefirst
horizontalcommandoftheparagraphdoesnotwork.Themomentofinsertionofthe
\everypartokensisabettercandidate:specifying
\everypar={{\setbox0=\lastbox}}
leadstounindentedparagraphs,evenif\parindentisnotzero.
16.4.3 Anindentationscheme
Theaboveideaoflettingtheindentationboxberemovedby\everyparcanbeputtouse
inasystematicapproachtoindentation,wheretwoconditionals
\newif\ifNeedIndent %as a rule
\newif\ifneedindent %special cases
controlwhetherparagraphsshouldindentasarule,andwhetherinspecialcasesindentation
isneeded.Thissectionistakenfrom[8].
Wetakeafixed\everypar:
\everypar={\ControlledIndentation}
whichexecutesinsomecasesthemacro\RemoveIndentation
VictorEijkhout–T
E
XbyTopic
163
C# PDF bookmark Library: add, remove, update PDF bookmarks in C#.
Help to add or insert bookmark and outline into PDF file in .NET framework. Ability to remove and delete bookmark and outline from PDF document.
add and delete pages from pdf; cut pages from pdf file
C# PDF metadata Library: add, remove, update PDF metadata in C#.
Add metadata to PDF document in C# .NET framework program. Remove and delete metadata from PDF file. Also a PDF metadata extraction control.
delete pages in pdf online; add and delete pages in pdf
Chapter16. ParagraphStart
\def\RemoveIndentation{{\setbox0=\lastbox}}
Theimplementationof\ControlledIndentationis:
\def\ControlledIndentation
{\ifNeedIndent \ifneedindent
\else \RemoveIndentation\needindenttrue \fi
\else \ifneedindent \needindentfalse
\else
\RemoveIndentation
\fi
\fi}
In order to regulateindentation forawholedocument,theusernowoncespecifies,for
instance,
\NeedIndenttrue
toindicatethat,inprinciple,allparagraphsshouldindent.Macrossuchas\sectioncan
thenpreventindentationinindividualcases:
\def\section#1{ ... \needindentfalse}
16.4.4 Aparagraphskipscheme
Theuseof\everypartocontrolindentation,aswassketchedabove,canbeextendedto
theparagraphskip.
Avisiblewhitespacebetweenparagraphscanbecreatedbythe\parskipparameter,but,
oncethisparameterhasbeensettosomevalue,itisdifficulttopreventparagraphskipin
certainplaceselegantly.Usually,whitespaceaboveandbelowenvironmentsandsection
headingsshouldbespecifiableindependentlyoftheparagraphskip.Thissectionsketches
anapproachwhere\parskipissettozerodirectlyaboveandbelowcertainconstructs,
whilethe\everyparisusedtorestoreformervalues.Thissectionistakenfrom[9].
Firstofall,herearetwotools.Thecontrolsequence\csargwillbeusedonlyinsideother
macros;atypicalcallwilllooklike
\csarg\vskip{#1Parskip}
Hereisthedefinition:
\def\csarg#1#2{\expandafter#1\csname#2\endcsname}
Nextfollowsageneralizationof\vskip:themacro\vspacewillnotplaceitsargument
ifthepreviousglueitemislarger;otherwiseitwilleliminatetheprecedingglue,andplace
itsargument.
\newskip\tempskipa
\def\vspace#1{\tempskipa=#1\relax
\ifvmode \ifdim\tempskipa<\lastskip
\else \vskip-\lastskip \vskip\tempskipa \fi
\else
\vskip\tempskipa \fi}
Nowassumethatanyconstructfoowithsurroundingwhitespacestartsandendswithma-
crocalls\StartEnvironment{foo}and\EndEnvironment{foo}respectively.Further-
more,assumethattothisenvironmenttherecorrespondthreeglueregisters:the\fooStartskip
164
VictorEijkhout–T
E
XbyTopic
VB.NET PDF remove image library: remove, delete images from PDF in
Image: Insert Image to PDF. Image: Remove Image from Redact Text Content. Redact Images. Redact Pages. Annotation & Highlight Text. Add Text. Add Text Box. Drawing
delete pdf pages android; delete pages from pdf in preview
VB.NET PDF metadata library: add, remove, update PDF metadata in
Add permanent metadata to PDF document in VB .NET framework program. Remove and delete metadata content from PDF file in Visual Basic .NET application.
copy pages from pdf to another pdf; delete pages from pdf file online
16.4. Examples
(glueabovetheenvironment),\fooParskip(theparagraphskipinsidetheenvironment),
andthe\fooEndskip(gluebelowtheenvironment).
Forrestoringthevalueoftheparagraphskipaconditionalandaglueregisterareneeded:
\newskip\TempParskip \newif\ifParskipNeedsRestoring
Thebasicsequenceforthestartingandendingmacrosfortheenvironmentsisthen
\TempParskip=\parskip\parskip=0cm\relax
\ParskipNeedsRestoringtrue
Theimplementationscannowbegivenas:
\def\StartEnvironment#1{\csarg\vspace{#1Startskip}
\begingroup % make changes local
\csarg\TempParskip{#1Parskip} \parskip=0cm\relax
\ParskipNeedsRestoringtrue}
\def\EndEnvironment#1{\csarg\vspace{#1Endskip}
\endgroup % restore global values
\ifParskipNeedsRestoring
\else \TempParskip=\parskip \parskip=0cm\relax
\ParskipNeedsRestoringtrue
\fi}
The\EndEnvironmentmacroneedsalittlecomment:ifan environmentisusedinside
anotherone,anditoccursbeforethefirstparagraphinthatenvironment,thevalueofthe
paragraph skip for theouter environment hasalreadybeen saved. Thereforeno further
actionsarerequiredinthatcase.
Note that both macros start with a vertical skip. This prevents the\begingroup and
\endgroupstatementsfromoccurringinaparagraph.
Wenowcometothemainpoint:ifnecessary,the\everyparwillrestorethevalueofthe
paragraphskip.
\everypar={\ControlledIndentation\ControlledParskip}
\def\ControlledParskip
{\ifParskipNeedsRestoring
\parskip=\TempParskip \ParskipNeedsRestoringfalse
\fi}
VictorEijkhout–T
E
XbyTopic
165
Chapter 17
Paragraph End
T
E
X’smechanismforendingaparagraphisingeniousandeffective.Thischapterexplains
themechanism,theroleof\parinit,anditgivesanumberofpracticalremarks.
\par Finishoffaparagraphandgointoverticalmode.
\endgraf Synonymfor\par:\let\endgraf=\par
\parfillskip Gluethatisplacedbetweenthelastelementoftheparagraphandtheline
end.PlainT
E
Xdefault:0pt plus 1fil.
17.1 Thewayparagraphsend
Aparagraphisterminatedbytheprimitive\parcommand,whichcanbeexplicitlytyped
bytheuser(orinsertedbyamacroexpansion):
... last words.\par
A new paragraph ...
ItcanbeimplicitlygeneratedintheinputprocessorofT
E
Xbyanemptyline(seeChap-
ter2):
... last words.
A new paragraph ...
The\parcanbeinsertedbecauseaverticalcommandoccurredinunrestrictedhorizontal
mode:
... last words.\vskip6pt
A new paragraph ...
Also,aparagraphendsifaclosingbraceisfoundinhorizontalmodeinside\vbox,\insert,
or\output.
Afterthe\parcommandT
E
Xgoesintoverticalmodeandexercisesthepagebuilder(see
page233).If the\parwasinsertedbecauseaverticalcommandoccurred in horizontal
mode,theverticalcommandisthenexaminedanew.The\pardoesnotinsertanyvertical
glueorpenaltiesitself.A\parcommandalsoclearstheparagraphshapeparameters(see
Chapter18).
166
17.2. Assortedremarks
17.1.1 The\parcommandandthe\partoken
Itisimportanttodistinguishbetweenthe\partokenandtheprimitive\parcommandthat
istheinitialmeaningofthattoken.The\partokenisinsertedwhentheinputprocessor
seesanemptyline,orwhentheexecutionprocessorfindsaverticalcommandinhorizon-
talmode;the\parcommandiswhatactuallyclosesoffaparagraph.Decouplingthetoken
andthecommandisanimportanttoolforspecialeffectsinparagraphs(seesomeexamples
inChapters5and9).
17.1.2 Paragraphfilling:\parfillskip
AfterthelastelementoftheparagraphT
E
Ximplicitlyinsertstheequivalentof
\unskip \penalty10000 \hskip\parfillskip
The\unskipservestoremoveanyspuriousglueattheparagraphend,suchasthespace
generatedbythelineendifthe\parwasinsertedbytheinputprocessor.Forexample:
end.
\noindent Begin
resultsinthetokens
end.\parBegin
Withthesequenceinsertedbythe\parthisbecomes
end.\unskip\penalty10000\hskip ...
whichinturngives
end.\penalty ...
The\parfillskipisinplainT
E
Xfirst-orderinfinite(0pt plus 1fil),soendingapa-
ragraphwith\hfil$\bullet$\parwillgiveabullethalfwaybetweenthelastwordand
thelineend;with\hfill$\bullet$\paritwillbeflushright.
17.2 Assortedremarks
17.2.1 Endingaparagraphandagroupatthesametime
Ifaparagraphissetinagroup,itmaybenecessarytoensurethatthe\parendingthepara-
graphoccursinsidethegroup.Theparametersinfluencingthetypesettingoftheparagraph,
suchasthe\leftskipandthe\baselineskip,areonlylookedatwhentheparagraphis
finished.Thusfinishingoffaparagraphwith
... last words.}\par
causesthevaluestobeusedthatprevailoutsidethegroup,insteadofthoseinside.
Betterwaystoendtheparagraphare
... last words.\par}
or
... last words.\medskip}
Inthesecondexampletheverticalcommand\medskipcausesthe\partokentobeinser-
ted.
VictorEijkhout–T
E
XbyTopic
167
Chapter17. ParagraphEnd
17.2.2 Endingaparagraphwith\hfill\break
Thesequence\hfill\breakisawaytoforcea‘newline’insideaparagraph.Ifyouenda
paragraphwiththis,however,youwillprobablygetanUnderfull \hboxerror.Surprisin-
gly,theunderfullboxisnotthebrokenline–afterall,thatonewasfilled–butacompletely
emptyboxfollowingit(actually,itdoescontainthe\leftskipand\rightskip).
Whathappens?Theparagraphendswith
\hfill\break\par
whichturnsinto
\hfill\break\unskip\nobreak\hskip\parfillskip
The\unskipfindsnoprecedingglue,sothe\breakisfollowedbyapenaltyitemanda
glueitem,bothofwhichdisappearafterthelinebreakhasbeenchosenatthe\break.Ho-
wever,T
E
Xhasalreadydecidedthatthereshouldbeanextraline,thatis,an\hbox to \hsize.
Andthereisnothingtofillitwith,soanunderfullboxresults.
17.2.3 Endingaparagraphwitharule
Seepage102forparagraphsendingwithruleleadersinsteadofthedefault\parfillskip
whitespace.
17.2.4 Nopagebreaksinbetweenparagraphs
The\parcommanddoesnotinsertanyglueintheverticallist,sointhesequence
... last words.\par \nobreak \medskip
\noindent First words ...
nopagebreakswilloccurbetweentheparagraphs.Theverticallistgeneratedis
\hbox(6.94444+0.0)x ...
% last line of paragraph
\penalty 10000
% \nobreak
\glue 6.0 plus 2.0 minus 2.0 % \medskip
\glue(\parskip) 0.0 plus 1.0 % \parskip
\glue(\baselineskip) 5.05556 % interline glue
\hbox(6.94444+0.0)x ...
% first line of paragraph
T
E
Xwillnotbreakthisverticallistabovethe\medskip,becausethepenaltyvalueprohibits
it; itwill not breakat any other place,becauseitcan onlybreak atglueifthat glueis
precededbyanon-discardableitem.
17.2.5 Finite\parfillskip
InplainT
E
X,\parfillskiphasa(first-order)infinitestretchcomponent.Allotherglue
inthelastlineofaparagraphwillthenbesetatnaturalwidth.Ifthe\parfillskiphas
only finite(or possiblyzero) stretch, otherglue willbestretched or shrunk.A display
formulainaparagraphwithsuchalastlinewillbesurroundedby\abovedisplayskip
and\belowdisplayskip,evenif\abovedisplayshortskipgluewouldbeinorder.
Thereasonforthisisthatgluesettingisslightlymachine-dependent,andanysuchproces-
sesshouldbekeptoutofT
E
X’sglobaldecisions.
168
VictorEijkhout–T
E
XbyTopic
17.2. Assortedremarks
17.2.6 Aprecautionforparagraphsthatdonotindent
Ifyouaresettingatextwithboththeparagraphindentationandthewhitespacebetween
paragraphszero,youruntheriskthatthestart ofanewparagraphmaybeindiscernible
whenthelastlineofthepreviousparagraphendsalmostorcompletelyflushright.Asen-
sibleprecautionforthisistosetthe\parfillskipto,forinstance
\parfillskip=1cm plus 1fil
insteadoftheusual0cm plus 1fil.
Ontheotherhand,youmayletyourselfbeconvincedby[46]thatparagraphsshouldalways
indent.
VictorEijkhout–T
E
XbyTopic
169
Documents you may be interested
Documents you may be interested