Ciao a tutti.
Gironzolando ho trovato un interessante articolo di Massimo Lofrano che spiegava come convertire un file doc (in generale un file *.ps) in PDF.
Dal momento che stavo cercando qualcosa di analogo per un problema simile l'ho scaricato e provato subito.
Premetto che io uso:
- Windows 7 Ultimate ITA x64
- 4 GB RAM
- La libreria gsdll32.dll appartiene alla versione del GhostScript 8.63
- Ambiente di sviluppo: MS Visual Basic 2008 Express Edition
Avviando l'applicazione a corredo dell'articolo "Come utilizzare Dll non referenziabili per convertire un documento Word in PDF" il programma arriva alla seguente riga nella classe "GSApi"
' Load Ghostscript and get the instance handle
intReturn = gsapi_new_instance(intGSInstanceHandle, callerHandle)
e restituisce l'errore in oggetto di cui riporto l'intero dettaglio di eccezione qui sotto:
System.BadImageFormatException non è stata gestita Message="Tentativo di caricare un programma con un formato non corretto. (Eccezione da HRESULT: 0x8007000B)" Source="GSAPIWinApp" StackTrace: in GSAPIWinApp.GSApi.gsapi_new_instance(IntPtr& lngGSInstance, IntPtr lngCallerHandle) in GSAPIWinApp.GSApi.CallGS(String[] astrGSArgs) in F:\dati_infonet\robi\Visual Studio 2008\Projects\GSAPIWinApp\GSAPIWinApp\gsapi_vbnet.vb:riga 216 in GSAPIWinApp.GSApi.ConvertFile(String Fileps, String filepdf) in F:\dati_infonet\robi\Visual Studio 2008\Projects\GSAPIWinApp\GSAPIWinApp\gsapi_vbnet.vb:riga 298 in GSAPIWinApp.fMain.Button1_Click(Object sender, EventArgs e) in F:\dati_infonet\robi\Visual Studio 2008\Projects\GSAPIWinApp\GSAPIWinApp\fMain.vb:riga 14 in System.Windows.Forms.Control.OnClick(EventArgs e) in System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) in System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) in System.Windows.Forms.Control.WndProc(Message& m) in System.Windows.Forms.ButtonBase.WndProc(Message& m) in System.Windows.Forms.Button.WndProc(Message& m) in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) in System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) in System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) in System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) in System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) in GSAPIWinApp.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:riga 81 in System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) in System.Threading.ThreadHelper.ThreadStart() InnerException:
Come posso fare???