actually margins are supported by the epub spec: http://www.idpf.org/doc_library/epub/OPS_2.0.1_draft.htm
I notice in the html file in the epub (see file: generated epub.epub.zip) there are margins being set but not honoring the *** section.PageSetup.LeftMargin = ConvertUtil.InchToPoint(5); ***
see screenshot: html file in epub.JPG
I decide to do a test with just generating a stand alone html file (see file: generatedhtml.zip) and checked to see if the margins will be ConvertUtil.InchToPoint(5)
see screenshot: stand alone html file.JPG
I also generated a docx file and the 5 inch margin was honored (see file: generated docx.docx)
It looks like Aspose is hard coding the margins to 0pt
Is there a way to prevent this?
My code to convert is below:
ParagraphResolver taken from https://forum.aspose.com/t/63225
Document doc = new Document(_sourceFilePath);
ParagraphResolver resolver = new ParagraphResolver();
doc.Accept(resolver);
doc.Range.Replace("\v", string.Empty, false, false);
NodeCollection paragraphs = doc.GetChildNodes(NodeType.Paragraph, true);
foreach (Paragraph paragraph in paragraphs)
{
paragraph.ParagraphFormat.Alignment = ParagraphAlignment.Justify;
}
foreach (Section section in doc.Sections)
{
section.PageSetup.LeftMargin = ConvertUtil.InchToPoint(5);
}
// to generate docx file - generated docx.docx
doc.Save(_destinationFilePath, SaveFormat.Docx);
// to generate html file - generatedhtml.zip
HtmlSaveOptions opt = new HtmlSaveOptions();
opt.ExportPageSetup = true;
doc.Save(_destinationFilePath, opt);
// to generate epub file - generated epub.epub.zip
HtmlSaveOptions opt = new HtmlSaveOptions(SaveFormat.Epub);
opt.ExportPageSetup = true;
doc.Save(temp, opt);
Thanks in advance...