Skip to main content

Class: ModifyPresentationHelper

Defined in: src/helper/modify-presentation-helper.ts:8

Constructors​

Constructor​

new ModifyPresentationHelper(): ModifyPresentationHelper

Returns​

ModifyPresentationHelper

Properties​

MIN_SLIDE_MASTER_ID​

readonly static MIN_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()​

static getSlideMastersCollection(xml): LiveNodeList<Element>

Defined in: src/helper/modify-presentation-helper.ts:15

Parameters​

xml​

Document

Returns​

LiveNodeList<Element>


getSlidesCollection()​

static getSlidesCollection(xml): LiveNodeList<Element>

Defined in: src/helper/modify-presentation-helper.ts:12

Get Collection of slides

Parameters​

xml​

Document

Returns​

LiveNodeList<Element>


normalizeSlideIds()​

static normalizeSlideIds(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()​

static normalizeSlideMasterIds(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_ID if 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()​

static removedUnusedImages(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()​

static removeSlides(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()​

static removeUnusedContentTypes(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()​

static removeUnusedFiles(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()​

static sortSlides(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