Class: ModifyPresentationHelper
Defined in: src/helper/modify-presentation-helper.ts:8
Constructors
Constructor
new ModifyPresentationHelper():
ModifyPresentationHelper
Returns
ModifyPresentationHelper
Properties
MIN_SLIDE_MASTER_ID
readonlystaticMIN_SLIDE_MASTER_ID:2147483648=2147483648
Defined in: src/helper/modify-presentation-helper.ts:60
Smallest id PowerPoint accepts for p:sldMasterId / p:sldLayoutId
(ids below 2^31 trigger the repair prompt; see #85).
Methods
getSlideMastersCollection()
staticgetSlideMastersCollection(xml):LiveNodeList<Element>
Defined in: src/helper/modify-presentation-helper.ts:15
Parameters
xml
Document
Returns
LiveNodeList<Element>
getSlidesCollection()
staticgetSlidesCollection(xml):LiveNodeList<Element>
Defined in: src/helper/modify-presentation-helper.ts:12
Get Collection of slides
Parameters
xml
Document
Returns
LiveNodeList<Element>
normalizeSlideIds()
staticnormalizeSlideIds(xml):void
Defined in: src/helper/modify-presentation-helper.ts:48
Set ids to prevent corrupted pptx. Must start with 256 and increment by one.
Parameters
xml
Document
Returns
void
normalizeSlideMasterIds()
staticnormalizeSlideMasterIds(xml,i,archive):Promise<void>
Defined in: src/helper/modify-presentation-helper.ts:74
Update slideMaster ids to prevent corrupted pptx.
- Take first slideMaster id from presentation.xml to start (raised to
MIN_SLIDE_MASTER_IDif it is lower), - then update incremental ids of each p:sldLayoutId in the master part the entry's relationship points at (starting by slideMasterId + 1)
- and update next slideMaster id with previous p:sldLayoutId + 1
p:sldMasterId-ids and p:sldLayoutId-ids need to be in a row, otherwise PowerPoint will complain on any p:sldLayoutId-id lower than its corresponding slideMaster-id. omg.
Parameters
xml
Document
i
number
archive
IArchive
Returns
Promise<void>
removedUnusedImages()
staticremovedUnusedImages(xml,i,archive):Promise<void>
Defined in: src/helper/modify-presentation-helper.ts:178
Parameters
xml
Document
i
number
archive
IArchive
Returns
Promise<void>
removeSlides()
staticremoveSlides(numbers): (xml) =>void
Defined in: src/helper/modify-presentation-helper.ts:34
Pass an array of slide numbers to remove from slide sortation.
Parameters
numbers
number[]
Array of slide numbers, starting by 1
Returns
(xml) => void
removeUnusedContentTypes()
staticremoveUnusedContentTypes(xml,i,archive):Promise<void>
Defined in: src/helper/modify-presentation-helper.ts:161
PPT won't complain about unused items in [Content_Types].xml, but we remove them anyway in case the file mentioned in PartName- attribute does not exist.
Parameters
xml
Document
i
number
archive
IArchive
Returns
Promise<void>
removeUnusedFiles()
staticremoveUnusedFiles(xml,i,archive):Promise<void>
Defined in: src/helper/modify-presentation-helper.ts:125
The content tracker's files include all files that have been copied to the root template by automizer. We remove all other files.
Parameters
xml
Document
i
number
archive
IArchive
Returns
Promise<void>
sortSlides()
staticsortSlides(order): (xml) =>void
Defined in: src/helper/modify-presentation-helper.ts:24
Pass an array of slide numbers to define a target sort order. First slide starts by 1.
Parameters
order
number[]
Array of slide numbers, starting by 1
Returns
(xml) => void