Support Center

exception creating pdf file

Steve Fowler May 13, 2015 09:35AM EDT

When we import certain image files and then save them as PDF using the following


We then end up with the following stack trace.

at DTI.ImageMan.Codecs.EncoderUtility.Save(Stream stream, ImImage image, ProcessEventHandler process)
at DTI.ImageMan.Codecs.PdfEncoder.Save(Stream stream, ImImage image, ProcessEventHandler process)
at DTI.ImageMan.ImageCollection.Save(Stream stream, Int32 startpage, Int32 pagesToSave, ImEncoder encoder)
at DTI.ImageMan.ImageCollection.Save(String filename, Int32 startpage, Int32 pages, ImEncoder encoder)
at DTI.ImageMan.ImageCollection.Save(String filename)
at DTI.ImageMan.Winforms.Viewer.Save(String filename)
at ImageTest.Form1.Button2_Click(Object sender, EventArgs e) in C:\My Documents\Visual Studio 2012\Projects\ImageTest\ImageTest\Form1.vb:line 69
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at ImageTest.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

3 Data Techniques Responses and 1 Community Responses

Up 0 Rated Down
DTI Support  Data Techniques Employee May 13, 2015 09:48AM EDT


What is the exception text/message when you get this exception ?

Thanks for your interest in our products and please let us know if you have any questions.

Data Techniques Support

Up 0 Rated Down
DTI Support  Data Techniques Employee May 13, 2015 01:22PM EDT


Can you email us the file you are trying to save ? Pls send it to :

Thanks for your interest in our products and please let us know if you have any questions.

Data Techniques Support

Up 0 Rated Down
Steve Fowler  Data Techniques Employee May 18, 2015 09:42AM EDT

We've managed to solve the problem, seems your software cannot handle saving 32 bit images as PDF's

You have to first check if the image is compatible using encode.IsCompatibleFormat, and convert it down to one that you handle using bitDepthChanger before saving it.

It might be a good idea to have something like "bit depth not supported" when trying to call save function and exit gracefully instead of just crashing the application.


Up 0 Rated Down
DTI Support  Data Techniques Employee May 18, 2015 05:10PM EDT

Good Morning,

Yes, the exception should be much clearer as to why its failing. We'll be fixing that in our next maintenance release.

Data Techniques

This question is closed to new answers.

Contact Us