Quantcast
Channel: html2openxml Discussions Rss Feed
Viewing all articles
Browse latest Browse all 228

New Post: Change Orientation to landscape

$
0
0
I've been interested in ways to add section breaks to Export to Word, both to do Landscape Orientation and also to reset page numbering. Thank you for posting this.

So far, however, I haven't gotten the above code to work for me. What I have been asked to do is switch to landscape orientation based off of a <div> class attribute, similar to how page breaks are done. For instance, HtmlToOpenXml supports the following for page breaks:
<div style="page-break-after:always">&nbsp;</div>
I've been asked to support something similar for landscape, like:
<div class="SectionBreakLandscape">&nbsp;</div>
I tried to take the above code and apply it to HtmlConverter.ProcessContainerAttributes, where page breaks are set:
                string classValue = en.Attributes["class"];
                if (classValue == "SectionBreakLandscape")
                {
                    paragraphs.Add(new Paragraph(new ParagraphProperties(new SectionProperties(ChangeOrientationToLandscape()))));
                    newParagraph = true;
                }
However, no section break occurs and the page does not switch to landscape. What am I missing to make this work?

Viewing all articles
Browse latest Browse all 228

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>