farling42 / fvtt-pdf-pager

PDF Pager for Foundry
MIT License
6 stars 4 forks source link

Allow migration of PDFoundry flags to this module's settings on each PDF page. #3

Closed farling42 closed 1 year ago

farling42 commented 1 year ago

Each journal entry created by PDFoundry has the following in its flags:

flags.pdfoundry.PDFData =
{
    cache: true
    code: "CTS"
    name: "Claim the Sky"
    offset: 2
    type: "static"
    url:  "userdata/cyphersystem/Claim_the_Sky-2021-11-02.pdf"
}

We can convert this to a JournalEntryPage:

entry.createEmbeddedDocuments("JournalEntryPage", [{
   name: "${orig.name}",
   type: "pdf",
   flags: { "pdf-pager" : { pageOffset: ${orig.offset} }},
   src: "${orig.url}"
}]);
farling42 commented 1 year ago

Automatically done at startup in V0.2.0 for journal entries in the world, but not for compendiums.