Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created October 10, 2023 12:47
Show Gist options
  • Save bjoerntx/d7dd443503c18d3f0517bcd915ce1cac to your computer and use it in GitHub Desktop.
Save bjoerntx/d7dd443503c18d3f0517bcd915ce1cac to your computer and use it in GitHub Desktop.
public string[] CreateSVG(ServerTextControl TextControl,
bool GlyphOutlines = false,
int FromPage = 1,
int ToPage = -1)
{
// create array for SVGs
string[] svgPages = new string[(ToPage == -1 ? TextControl.Pages : ToPage)];
// set page content
TXTextControl.Page.PageContent pageContent =
GlyphOutlines ? TXTextControl.Page.PageContent.All | TXTextControl.Page.PageContent.GlyphOutlines
: TXTextControl.Page.PageContent.All;
for (int i = FromPage; i <= (ToPage == -1 ? TextControl.Pages : ToPage); i++)
{
// get SVG from page
svgPages[i - 1] = TextControl.GetPages()[i].GetImage(pageContent, 96);
}
return svgPages;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment