cancel
Showing results for 
Search instead for 
Did you mean: 

Remove the 2mb limit for Convert File

Can the 2mb precondition limit be removed from the Convert File action?

 

 

{
  "status": 412,
  "message": "The html content length cannot be greater than 2 MB\nInnerExceptionMessage: \nStackTrace:    at OneDrive.Media.Transforms.Rasterizers.HtmlRasterizer.ValidateLength(String htmlContent, Int64 maxLength) in C:\\agent\\1\\_work\\1\\s\\Transforms\\Rasterizers\\HtmlRasterizer.cs:line 202\r\n   at OneDrive.Media.Transforms.Rasterizers.HtmlRasterizer.<>c__DisplayClass18_0.<Generate>b__0() in C:\\agent\\1\\_work\\1\\s\\Transforms\\Rasterizers\\HtmlRasterizer.cs:line 120\r\n   at OneDrive.Media.Utilities.MemoryStreamHelper.ExecuteAndDisposeStreamIfErrorOccurs(Stream outputStream, Action method) in C:\\agent\\1\\_work\\1\\s\\Utilities\\MemoryStreamHelper.cs:line 58\r\n   at OneDrive.Media.Transforms.Rasterizers.HtmlRasterizer.Generate(String htmlContent, ConvertHtmlParameters parameters) in C:\\agent\\1\\_work\\1\\s\\Transforms\\Rasterizers\\HtmlRasterizer.cs:line 114\r\n   at OneDrive.Media.Transforms.Rasterizers.HtmlRasterizer.<ConvertHtmlAsync>d__17.MoveNext() in C:\\agent\\1\\_work\\1\\s\\Transforms\\Rasterizers\\HtmlRasterizer.cs:line 98\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at OneDrive.Media.Transforms.Rasterizers.HtmlRasterizer.<ConvertWithinSandboxAsync>d__16.MoveNext() in C:\\agent\\1\\_work\\1\\s\\Transforms\\Rasterizers\\HtmlRasterizer.cs:line 83\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at OneDrive.Media.Utilities.Sandbox.SandboxService.<RunRequestAsync>d__1.MoveNext() in C:\\agent\\1\\_work\\1\\s\\Sandbox\\SandboxService.cs:line 55\n ThrowSite: ",
  "source": "api.connectorp.svc.ms"
}

 

Seems an odd limitation to impose

 

Posted as per the suggestion of @v-yamao-msft 

https://powerusers.microsoft.com/t5/Building-Flows/Convert-File-PreconditionFailed/m-p/177559/highli...

Status: New
Comments
Advocate II

It is an essential need for one of our projects at the company. Please change the limit to at least 50 MB !

Responsive Resident

Agreed.  2Mb?  What year is it?

 

Wish this were getting more traction, it'd solve a big problem for me.

Regular Visitor

I also need a solution for this issue

Frequent Visitor

2 MB in 2019 ...

Frequent Visitor

Hi,

 

I have been waiting for this too but meanwhile I found a work around which works for me. Please use if it works for you:

The key step is to embed Java script provided here into your HTML which adds a "save as PDF" button at the end of your HTML. Then,

 

1) Seperate flow into 2 branches after convert HTML to PDF.

2) If convert succeeds, go with the regular flow.

3) If it fails, send HTML as attachment and (optionally embed that HTML as body) then use Save as PDF button in the HTML to save it as PDF easily.

 

Again, in my case, users need the PDF emailed. So, even if I email them the HTML with a save as PDF button, my users wouldn't mind clicking it and save it. If this works for you, please do use it that way until the 2MB limitation is lifted.  

Advocate II

@testtest123test, would you mind to explain your solution in more detail? Where do your store the javascript-code? How does you html-script look like?

 

Thanks!