1
Error Parameter is not valid.
Problem reported by Ben Knoll - 6/18/2021 at 9:13 AM
Submitted
Hello, I am getting the following error when trying to view a PNG or BMP file. PDF works ok. 
Loading the view like this:

return View(new DocumentViewer
                {
                    HighQualityEnabled = true,
                    DisplayMode = GleamTech.AspNet.UI.DisplayMode.Viewport,
                    SinglePageRotationEnabled = true,
                    FitMode = FitMode.FitPage,
                    DebugMode = true,
                    FormatLanguage = language,
                    DocumentSource = docSource,
                });

Any help would be appreciated.


{
  "Type": "GleamTech.DocumentUltimate.AspNet.UI.DocumentViewerException",
  "Message": "Parameter is not valid.",
  "StackTrace": "   at GleamTech.DocumentUltimate.AspNet.UI.DocumentViewerHandler.PrepareDocument(String cacheInfoKey, String attachment)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at GleamTech.Reflection.MethodInvoker.Invoke(Object instance, Object[] parameters)\r\n   at GleamTech.Reflection.MethodInvoker.GleamTech.Reflection.IMethodInvoker.Invoke(Object instance, Object[] parameters)\r\n   at GleamTech.AspNet.JsonMethodHandler.ExecuteMethod(MethodConfig methodConfig, Object[] parameterValues)\r\n   at GleamTech.AspNet.UI.ComponentHandler`1.ExecuteMethod(MethodConfig methodConfig, Object[] parameterValues)\r\n   at GleamTech.AspNet.JsonMethodHandler.Execute()",
  "InnerException": {
    "Type": "System.ArgumentException",
    "Message": "Parameter is not valid.",
    "StackTrace": "   at System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement, Boolean validateImageData)\r\n   at System.Drawing.Image.FromStream(Stream stream)\r\n   at _ZrC._zHe(_Tsb pdfDoc, Stream stream, DocumentFormat format)\r\n   at _ZrC._YBd._zlC(Stream stream)\r\n   at _Y7d._YQD(ConversionContext conversionContext, Action`1 diskLoadCallback, Action`1 streamLoadCallback)\r\n   at _ZrC._YQD(InputContext inputContext)\r\n   at GleamTech.DocumentUltimate.DocumentConverter._z9C(OutputContext outputContext, Nullable`1 engine)\r\n   at GleamTech.DocumentUltimate.DocumentConverter.ConvertTo(Stream outputStream, OutputOptions outputOptions, Nullable`1 engine)\r\n   at GleamTech.DocumentUltimate.AspNet.DocumentCache._YZD._zuC(Stream cacheFileStream)\r\n   at GleamTech.Caching.FileCache._TI(IDisposable context, FileSystem fileSystem, _0K cacheFileInfo, Action`1 createAction)\r\n   at GleamTech.Caching.FileCache.GetOrAdd(FileCacheKey cacheKey, Action`1 createAction)\r\n   at GleamTech.DocumentUltimate.AspNet.DocumentCache.GetOrAddPdf(DocumentCacheInfo cacheInfo)\r\n   at GleamTech.DocumentUltimate.AspNet.DocumentCache._zND._z2d(Stream cacheFileStream)\r\n   at GleamTech.Caching.FileCache._TI(IDisposable context, FileSystem fileSystem, _0K cacheFileInfo, Action`1 createAction)\r\n   at GleamTech.Caching.FileCache.GetOrAdd(FileCacheKey cacheKey, Action`1 createAction)\r\n   at GleamTech.DocumentUltimate.AspNet.DocumentCache.GetOrAddXpz(DocumentCacheInfo cacheInfo)\r\n   at GleamTech.DocumentUltimate.AspNet.UI.DocumentViewerHandler.PrepareDocument(String cacheInfoKey, String attachment)"
  }
}

2 Replies

Reply to Thread
0
Cem Alacayir Replied
Employee Post
This look similar to

Please make sure you are using a recent version.
0
Ben Knoll Replied
Cem, I am on the latest version. this is a PNG. file size its less than 50KB. I'm not sure any of those apply to this error.

Reply to Thread