Hello,
we are using Aspose.Pdf 16.12.0 for generating PDF document from HTML. We faced with problem that converting big documents (over 30Mb) causes OutOfMemoryException. Here code snippet:
public void GeneratePdf(Stream inputHtml, Stream outputPdf)
{
var htmlLoadOptions = new Aspose.Pdf.HtmlLoadOptions();
using (var pdfDocument = new Aspose.Pdf.Document(inputHtml, htmlLoadOptions))
{
pdfDocument.Save(outputPdf, Aspose.Pdf.SaveFormat.Pdf);
}
}
Result StackTrace:
в Aspose.CSS.Grammar.CSStLexer.Emit()
в Aspose.CSS.Grammar.CSStLexer.nextTokenRecover()
в Aspose.CSS.Grammar.CSStLexer.NextToken()
в Antlr.Runtime.CommonTokenStream.FillBuffer()
в Antlr.Runtime.CommonTokenStream.LT(Int32 k)
в Aspose.CSS.Grammar.CSStParser.inlinestyle()
в Aspose.CSS.Grammar.CSStParser.ParseInline()
в Aspose.CSS.Parser.CSSParser.ParseInlineStyle(String source)
в Aspose.CSS.Engine.CSSEngine.ParseInlineStyle(String content, INode ownerNode)
в Aspose.CSS.Engine.AbstractCSSStyleDeclaration.ParseInlineStyle(String content)
в Aspose.CSS.Engine.AbstractCSSStyleDeclaration.SetProperty(String propertyName, String value, String priority)
в Aspose.CSS.Engine.StyleAttributesDeclarationsBuilder.SetTableCellValues(IElement element, CommonCSSStyleDeclaration declaration)
в Aspose.CSS.Engine.StyleAttributesDeclarationsBuilder.Create(IElement element)
в Aspose.CSS.Engine.CSSEngine.GetCascadedStyleMap(IElement element, String pseudoElement)
в Aspose.CSS.Engine.CSSEngine.ApplyStyles(IElement element)
в Aspose.CSS.Engine.CSSEngine.ApplyStyles(IElement element)
в Aspose.CSS.Engine.CSSEngine.ApplyStyles(IElement element)
в Aspose.CSS.Engine.CSSEngine.ApplyStyles(IElement element)
в Aspose.CSS.Engine.CSSEngine.ApplyStyles(IElement element)
в Aspose.CSS.Engine.CSSEngine.ApplyStyles(IElement element)
в Aspose.CSS.Engine.CSSEngine.ApplyStyles(ICSSStylableDocument document)
в Aspose.HTML.DOM.BrowsingContext.Open(ILSInput input)
в Aspose.HTML.DOM.BrowsingContext.Open(Stream data)
в Aspose.HTML.Browser.Window.Navigate(Stream stream, NavigationData data)
в Aspose.HTML.Rendering.Aps.ApsConverter.Convert(Stream stream, ConverterOptions options)
в .[1](Stream [1], Document
, UriResolver , HtmlLoadOptions )
в Aspose.Pdf.Document.[1](Stream [1], LoadOptions
)
в Aspose.Pdf.Document..ctor(Stream input, LoadOptions options)
We tried to increase memory, test Net 4.0 and Net 4.5.1. but causes OutOfMemoryException too.
What could be the reason? What the size limit of HTML? Is there a workaround, for example, using another object Aspose?