프로퍼티 | 타입 | 설명 | |
---|---|---|---|
AddAudioOverlay | void | ||
AddFontFace | void | ||
ConvertStyleFromPxToPercent | bool | ||
CopyFile | void | ||
CopyFileToEpub | string | ||
CopyImages | void | ||
CopyStyleSheets | void | ||
EmbedFonts | void | ||
FixChangedFileNames | void | ||
FixIllegalIds | void | ||
FixPictureSizes | void | ||
GetEpubFriendlyHtmlDomForPage | |||
GetIdOfFile | string | ||
GetMediaType | string | ||
GetOrCreateCompressedAudioIfWavExists | string | ||
GetOverlayName | string | ||
HasClass | bool | ||
IsCompressedAudioForIdMissing | bool | ||
MakeCompressedAudio | string | ||
MakeCssLinksAppropriateForEpub | void | ||
MakeManifest | void | ||
MakeNavPage | void | ||
MakePageFile | |||
MakeSpine | void | ||
RemoveBloomUiElements | void | ||
RemoveRegularStylesheets | void | ||
RemoveScripts | void | ||
RemoveSpuriousLinks | void | ||
RemoveUnwantedContent | void | ||
ToValidXmlId | string |
메소드 | 설명 | |
---|---|---|
Dispose ( ) : void | ||
EnsureEditableDivsHaveIds ( |
||
EpubMaker ( BookThumbNailer thumbNailer, NavigationIsolator _isolator ) : NAudio.Wave | ||
FinishEpub ( string destinationEpubPath ) : void |
Finish publishing an ePUB that has been staged, by zipping it into the desired final file.
|
|
GetFontsUsed ( string bookPath, bool includeFallbackFonts ) : IEnumerable |
First step of embedding fonts: determine what are used in the document. Eventually we may load each page into a DOM and use JavaScript to ask each bit of text what actual font and face it is using. For now we examine the stylesheets and collect the font families they mention.
|
|
RemoveTempIds ( |
||
SaveEpub ( string destinationEpubPath ) : void | ||
StageEpub ( bool publishWithoutAudio = false ) : void |
Generate all the files we will zip into the ePUB for the current book into the StagingFolder. It is required that the parent of the StagingFolder is a temporary folder into which we can copy the Readium stuff. This folder is deleted when the EpubMaker is disposed.
|
메소드 | 설명 | |
---|---|---|
AddAudioOverlay ( |
Create an audio overlay for the page if appropriate. We are looking for the page to contain spans with IDs. For each such ID X, we look for a file _storage.FolderPath/audio/X.mp{3,4}. If we find at least one such file, we create pageDocName_overlay.smil with appropriate contents to tell the reader how to read all such spans aloud.
|
|
AddFontFace ( StringBuilder sb, string name, string weight, string style, string path ) : void | ||
ConvertStyleFromPxToPercent ( string stylename, double pageWidthMm, double multiplier, string &imgStyle ) : bool | ||
CopyFile ( string srcPath, string dstPath ) : void |
This supports testing without actually copying files.
|
|
CopyFileToEpub ( string srcPath ) : string | ||
CopyImages ( |
||
CopyStyleSheets ( |
||
EmbedFonts ( ) : void |
Try to embed the fonts we need.
|
|
FixChangedFileNames ( |
||
FixIllegalIds ( |
||
FixPictureSizes ( |
Typically pictures are given an absolute size in px, which looks right given the current absolute size of the page it is on. For an ePUB, a percent size will work better. We calculate it based on the page sizes and margins in BasePage.less and commonMixins.less. The page size definitions are unlikely to change, but change might be needed here if there is a change to the main .marginBox rule in basePage.less. To partly accommodate origami pages, we adjust for parent divs with an explict style setting the percent width.
|
|
GetEpubFriendlyHtmlDomForPage ( |
||
GetIdOfFile ( string item ) : string |
Since file names often start with numbers, which ePUB validation won't allow for element IDs, stick an 'f' in front. Generally clean up file name to make a valid ID as similar as possible.
|
|
GetMediaType ( string item ) : string | ||
GetOrCreateCompressedAudioIfWavExists ( string id ) : string | ||
GetOverlayName ( string pageDocName ) : string | ||
HasClass ( |
||
IsCompressedAudioForIdMissing ( string id ) : bool | ||
MakeCompressedAudio ( string wavPath ) : string |
Make a compressed audio file for the specified .wav file. (Or return null if it can't be done becaus we don't have a LAME package installed.)
|
|
MakeCssLinksAppropriateForEpub ( |
||
MakeManifest ( string coverPageImageFile ) : void | ||
MakeNavPage ( ) : void | ||
MakePageFile ( |
||
MakeSpine ( System.Xml.Linq.XNamespace opf, System.Xml.Linq.XElement rootElt, string manifestPath ) : void | ||
RemoveBloomUiElements ( |
Remove anything that has class bloom-ui
|
|
RemoveRegularStylesheets ( |
||
RemoveScripts ( |
We don't need to make scriptable books, and if our html contains scripts (which probably won't work on most readers) we have to add various attributes. Also our scripts are external refs, which would have to be fixed.
|
|
RemoveSpuriousLinks ( |
Clean up any dangling pointers and similar spurious data.
|
|
RemoveUnwantedContent ( |
Remove stuff that we don't want displayed. Some e-readers don't obey display:none. Also, not shipping it saves space.
|
|
ToValidXmlId ( string item ) : string |
Given a filename, attempt to make a valid XML ID that is as similar as possible. - if it's OK don't change it - if it contains spaces remove them - if it starts with an invalid character add an initial 'f' - change other invalid characters to underlines We do this because ePUB technically uses XHTML and therefore follows XML rules. I doubt most readers care but validators do and we would like our ebooks to validate.
|
public EnsureEditableDivsHaveIds ( |
||
pageElt | ||
리턴 | void |
public EpubMaker ( BookThumbNailer thumbNailer, NavigationIsolator _isolator ) : NAudio.Wave | ||
thumbNailer | BookThumbNailer | |
_isolator | NavigationIsolator | |
리턴 | NAudio.Wave |
public FinishEpub ( string destinationEpubPath ) : void | ||
destinationEpubPath | string | |
리턴 | void |
public static GetFontsUsed ( string bookPath, bool includeFallbackFonts ) : IEnumerable |
||
bookPath | string | |
includeFallbackFonts | bool | |
리턴 | IEnumerable |
public RemoveTempIds ( |
||
pageElt | ||
리턴 | void |
public SaveEpub ( string destinationEpubPath ) : void | ||
destinationEpubPath | string | |
리턴 | void |
public StageEpub ( bool publishWithoutAudio = false ) : void | ||
publishWithoutAudio | bool | |
리턴 | void |