Powerbuilder 12 cannot save as pdf datawindow - pdf

I am running windows 2003 server. I had no problems doing a dw_1.saveas for a pdf until about 2 weeks ago when the hosting company decided to do a software update on the server. Now when I do a save as the file size is 0 kb. Any ideas?

I was also getting 0 byte files, running PB Classic 12.5.1 build 4541 on Windows 7 Enterprise SP1 64 bit. Based on the comments of both previous answers, I installed 32 bit Ghostscript 9.1 to default location, verified that the registry entry was not there, then installed 64 bit Ghostscript 9.1 to default location, saw the registry values were there, then modified the registry to point to the 32 bit installation directory as follows:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript]
[HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript\9.10]
"GS_DLL"="C:\\Program Files (x86)\\gs\\gs9.10\\bin\\gsdll32.dll"
"GS_LIB"="C:\\Program Files (x86)\\gs\\gs9.10\\bin;C:\\Program Files (x86)\\gs\\gs9.10\\lib;C:\\Program Files (x86)\\gs\\gs9.10\\fonts"
Save As PDF using Distill is now working.

Edit 2: Another cause I've seen is mis-matched PowerBuilder DLLs and PBDs. Make sure that the runtime DLLs and PBDs on the server are the same as the ones on the machine where the app was built.
Edit: I re-read your question. A zero byte PDF usually indicates that PowerBuilder couldn't find GhostScript. Check the registry as described below, and check the folder GhostScript is installed in. Re-running the GhostScript installer should fix it. I'll leave the rest of the troubleshooting info in case anyone else needs it.
If you're using Distill, the problem could be that the server configuration was changed to require signed drivers. If so, you'll have to install the "Sybase DataWindow PS" printer with a signed driver. I find the 'HP 8150 Series PS' driver works pretty well. I wrote up directions in Saving a datawindow as PDF in PB 10.5.
You might get a useful error message if you try to print to Sybase DataWindow PS from Notepad. Another possibility is that the Registry entries that PowerBuilder uses to find GhostScript got clobbered. We had that on a couple of workstations. Here's what I have for Ghostscript 8.60 (The GhostScript installer creates these entries):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript]
[HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript\8.60]
"GS_DLL"="C:\\Program Files\\gs\\gs8.60\\bin\\gsdll32.dll"
"GS_LIB"="C:\\Program Files\\gs\\gs8.60\\lib;C:\\Program Files\\gs\\fonts;C:\\Program Files\\gs\\gs8.60\\Resource"
I used Process Explorer to troubleshoot problems with PowerBuilder's Save as PDF functionality.

I had the same problem (PDF with 0 KB size) when I use Windows 2003 Server 64 bits and I resolve my problem like shown here :
=> At first, when I install Ghostscript 32 bits version, I see no entries in the Registry.
=> When I install a Ghostscript 64 bits version, there is no problem in the Registry, entries are created, but the system doesn't work (PDF is generated with 0 KB size)
=> I create a new directory with Ghosscript 32 bits version and I change the Registy entries
=> And then I uninstall the 64 bits version.
=> AND NOW, EVERYTHING IS OK !
Used Ghostscipt versions : gs904 for the 32 bits version and gs910 for the 64 bits one.

Related

Textext (Inkscape), GhostScript and MaTeX (mathematica) compatibility

The following question has to do with installation of the MaTeX package to Mathematica, and the difficulties I encounter in making it compatible with Inkscape’s Textext (LaTeX addon).
I first summarize my problem in Long story short (I have the detailed series of events in Long story). I then present my questions in Questions and supply some additional information regarding versions of the various programs in Supplementary Information.
Long story short
I am having issues with using both Textext add-on in Inkscape and MaTeX package in Wolfram's Mathematica. I have tried uninstalling and re-installing all related Inkscape programs but nothing seems to change.
Long story
I am using Inkscape to produce figures with LaTeX code (using textext according to this guide https://people.orie.cornell.edu/jmd388/design/guides/textext.pdf). I have previously installed Textext, and Inkscape was working well – allowing me to include LaTeX text in my figures.
I am also using Wolfram Mathematica. To include LaTeX text in Mathematica I needed to install the MaTeX package (from here https://github.com/szhorvat/MaTeX). However, once I did this, Textext stopped working.
I have uninstalled and reinstalled all inkscape’s related programs – pstoedit, ghostscript, GSview, ImageMagick, Textext and Inkscape itself – but still MaTeX wouldn’t work. Textext seems to be working now, but MaTeX does not.
The error Mathematica gives when running the MaTeX package is the following
MaTeX::gserr: Error while running Ghostscript.
After examinning this issue, I have realized that the problem might originate from the Ghostscript version. I have ran the following line in the command:
gswin64c.exe -o mt-gs.pdf -dNoOutputFonts -sDEVICE=pdfwrite mt.pdf
and the outcome I obtain is
**** Could not open temporary file ''
****Unable to open the initial device, quitting.
But when I only put
gswin64c.exe -o mt-gs.pdf -dNoOutputFonts mt.pdf
Ghostscript seems to operate (that is, a pdf window pops-up and immediately closes).
Additionally, when I try to run GS on a different pdf file, I get the following error
Could not open the scratch file encoded_file_ptr_0.
+ c:\users\cjl\artifex\gs-release'9.21\ghostpdl-9.21\base\gdevp14.c:6044: gs_pdf14_devide_push<>: Fatal
GPL Ghostscript 9.21: Unrecoverable error, exit code 255
where the same file works on a different computer's GS (so the file should be OK).
Overall, I cannot use MaTeX at the moment since I get this error, which forces me to produce figures in Mathematica and move them into Inkscape to include axis labels and other notations (such that the fonts are consistent).
Questions
What is wrong with my Ghostscript? How can I fix it?
Has anyone encountered such difficulties before (making Textext and MaTex packages work at the same time)?
Does anyone have an idea of how to fix MaTeX/Textext such that both would work?
Supplementary information
Here are the specs of my OS, as well as the versions of the different involved programs:
Windows 7 64-bit OS.
Mathematica verion 11.1.1.0 for Windows 64-bit.
Inkscape version 0.48
Ghostscript version 9.21
pstoedit and importps version 3.7
ImageMagick version 7.0.7 - Q16
Textext version 0.4.4
MiKTeX 2.9 (updated today).
I would really appreciate any comments and ideas.
Thanks in advance
There is nothing wrong with your Ghostscript command, but the pdfwrite device requires the ability to write temporary files to the system temporary directory. (other devices such as the default display device do not always require the ability to write temporary files)
The empty filename is suspicious in the error, that should not be possible.
There is clearly some kind of problem because the file 'encoded_file_ptr.0' couldn't be created either apparently, and that's a valid filename.
I'd have to guess at some kind of permissions problem. I note that you are running a Windows Ghostscript, are you running this under some kind of Linux-alike ? I'd be suspicious that there is some kind of permissions or access problem on the temp partition if so.
Have you tried running Ghostscript from the WIndows command shell ?

error Converting PDF to PNG - Python 3.6 and GhostScript

I have much trouble to have a code to convert pdf file to png on python 3.6, windows 10.
I know what you are going to say : google it !
But barely everything I've found was on python 2.7. And some packages haven't been updated.
What I've seen so far it's that the best way to do it is using Wand, right ? (I have installed ImageMagick before )
from wand.image import Image
# Converting first page into JPG
with Image(filename='0.pdf') as img:
img.save(filename="/temp.jpg")
# Resizing this image
Here was my second error :
wand.exceptions.DelegateError: PDFDelegateFailed
`The system cannot find the file specified.' # error/pdf.c/ReadPDFImage/809
So i read i need ghostscript. I installed it. But the package is for python 2.7 and it doesn't work. I found python3-ghostscript 0.5.0. https://pypi.python.org/pypi/python3-ghostscript/0.5.0
New error :
RuntimeError: Can not find Ghostscript DLL in registry
So here I needed to install Ghostscript 9 :
https://www.ghostscript.com/download/gsdnld.html
First of all it's not a GPL license ... That's not even a package but a program. I don't know how I can use it in my futures python codes...
and there is still an error :
RuntimeError: Can not find Ghostscript DLL in registry
and i can't find anything for it.
Ghostscript is licensed under the AGPL, the licence can be found in /Program Files (x86)/gs/gs9.21/doc if you want sources then they are available from the Ghostscript Git repository. Note I'm assuming you are running on Windows since you refer to the Registry.
If you install the prebuilt binary then it will create an entry in the Windows Registry, I assume that's what your Python code is looking for but I can't be sure. You should make sure you install the correct word size (32 or 64) version required by Python, if it cares.
You can, of course, simply run Ghostscript to render a PDF file and produce PNG output.
gswin32c -sDEVICE=png16m -sOutputFile=out%d.png input.pdf
This will create one file per page of the input PDF file, use gswin64c for the 64-bit version...
You can alter the resolution of the output with the -r switch, eg -r300
I presume you can simply fork a process from Python. Otherwise you'll have to get someone to tell you what the Python script is looking for in the Registry. Perhaps its looking for a specific version of Ghostscript, or the 32-bit version or something.

Apache/Perl Cannot Find MDAC without CommonProgramFiles(x86)

I am having a problem with using Apache/Perl to get access to Excel files using Microsoft Data Access Component (MDAC). Somehow I must set the "CommonProgramFiles(x86)" system environment variable in order to get this to work. Otherwise, I keep getting this error message:
System.InvalidOperationException: The .Net Framework Data Providers
require Microsoft Data Access Components(MDAC). Please install
Microsoft Data Access Components(MDAC) version 2.6 or later. --->
System.IO.FileNotFoundException: Retrieving the COM class factory for
component with CLSID {2206CDB2-19C1-11D1-89E0-00C04FD7A829} failed due
to the following error: 8007007e.
The server configuration is:
Windows Server 2008 R2 in 64-bit
Server is installed with Microsoft Access Database Engine 2010
Apache 2.2.25 (that is 32-bit)
Perl 5.12.3 v5 (that is also in 32-bit)
I have my Perl CGI script to call my C# program (that is built for "Any CPU").
The C# program uses MDAC to open and read Excel files (not trying to launch Excel, only try to read data from the Excel files).
I have verified that the server has the latest MDAC available in these 2 folders:
C:\Program Files\Common Files\System\Ole DB
C:\Program Files (x86)\Common Files\System\Ole DB
I have also checked the registries and they look fine. Anyway, I don't have any problem running my C# program directly at the command prompt (it can use MDAC to get access to Excel files). I only have the problem when I use Apache/Perl to use my Perl CGI script to call my C# program (that is when I get that error with MDAC).
I can work around this problem by specifying CommonProgramFiles(x86) in my Perl CGI script, like this:
$ENV{ "CommonProgramFiles(x86)" } = "C:\\Program Files (x86)\\Common Files";
I have this question:
Why do I have this problem? And why setting that CommonProgramFiles(x86) system environment variable can workaround this problem? Why that system environment variable is empty before I set it? Does this have to do with the fact that I am running 32-bit Apache/Perl in a Windows operating system that is 64-bit?
Please help me to understand this issue. Thanks in advance.
(The original version of this post had a question about a second problem. Turned out that problem had to do with an extra double quote in the string. I fixed this, and that problem has gone away. That's why I have removed that second question from the post)
Jay Chan
I did some more research and the issue is the following: until release 2.4.9, the Apache startup routines have mapped "commonprogramfiles(x86)" to "commonprogramfiles_x86_" and that variable does not exists in the environment unless you create it... I have not tested it, but creating that environment variable and making it point to the same location as commonprogramfiles(x86) would probably fix the issue too.
Since the compiled Apache distributions are only using up to version 2.4.46 as we speak, they don't have the fix that allows the parenthesis in environment variables. That's why you still need the PassEnv directive to ensure that Apache passes the correct values to 32-bit CGI scripts.
The following post has some useful details about this:
https://bz.apache.org/bugzilla/show_bug.cgi?id=46751
I used to have the same problem in with Apache 2.4 with dBase compiled apps using ADO-32 bit as dBase is 32-bit. Something has recently changed, possibly with Windows 10 2004 20H2. I needed this fix in July-Aug 2020 but now I don't, the environment variable already exists. Since my Apache version is dated April 2020, that cannot be the reason for the change.
I tried to do some research about this but all I could find is that those environment variables are system ones existing at least since 2017, so why I needed to set this var is a mystery to me, but I would like to understand this, so if you find something, post a follow-up...
https://learn.microsoft.com/en-us/windows/deployment/usmt/usmt-recognized-environment-variables

Windows Mobile Compact Framework Build Error: CAB file … could not be created

I get the following error when trying to build a .CAB in visual studio on my new PC. The source is identical. The Registry warnings are not present on the old PC either.
Windows CE CAB Wizard
Warning: Section [RegKeys] has no data
Warning: Section [DefaultInstall] key "AddReg" - there are no section entries to process
Error: CAB file "D:\Dev\...\MyProject.CAB" could not be created
ERROR: The Windows CE CAB Wizard encountered an error. See the output window for more information.
No other errors show in the build log for the cabwiz.exe build step.
Any suggestions?
Move the source code to C: drive and build it there, instead of D: drive.
It appears that when cabwiz.exe (Visual Studio) is installed on C: drive, it does not like building projects on D: drive.
Similar issues with network drives noted at http://windowsmobilepro.blogspot.co.uk/2005/11/error-cab-file-could-not-be-created-no.html
Finally I found an answer. All my problems comes from the 8.3 file name generation.
You have to check two thing.
Registry key NtfsDisable8dot3NameCreation under
HKLM/SYSTEM/CurrentControlSet/Control/FileSystem
Valid values are:
0 - Disable 8.3 name generation
1 - Enable 8.3 name generation
2 - Name generation will be evaulated by volume settings
Matty Brown suggested the following (not tested, but may help):
Valid values are (Windows 10 1809):
0 - Enable 8dot3 name creation on all volumes on the system
1 - Disable 8dot3 name creation on all volumes on the system
2 - Set 8dot3 name creation on a per volume basis
3 - Disable 8dot3 name creation on all volumes except the system volume
Volume based settings.
You need an admin command prompt. Check 8.3 name generation with
fsutil 8dot3name query d:
where "d:" is your volume
If the result inform you that your volume has disabled 8.3 name generation, you can set it easily with
fsutil 8dot3name set d:
Two more step is needed. You need a restart, and you have to move files from there and move it back to the original place.
The 8.3 name generation linked to the file operations.
Thats all.
I'm happy now with my new W10 ultrabook with VS2008 and a big WinCe 6 solution.
I know it's a bit too late, but I'll leave this tip for future visits:
Check for whitespaces in Solution & CAB project paths, and also in file names.
I ran into this error while trying to build a legacy CAB project on our new TFS Build Server running Windows 2012. Ironically, the script to build the mobile app and CAB project worked fine on my local development machine, but go the vague "Windows CE CAB Wizard Error: CAB file XXXXXX could not be created" error when I ran it on the build server, via both a TFS build definition or manually.
The article previously mentioned at http://windowsmobilepro.blogspot.co.uk/2005/11/error-cab-file-could-not-be-created-no.html was very thorough and helpful. I used the SUBST trick to shorten the project path and eliminate the spaces in the path names, and the script could then run on TFS / Win2012.

The procedure entry point CryptStringToBinaryW could not be located in the dynamic link library CRYPT32.dll

Can't install DVD-RW drive. An error occurs:
The procedure entry point CryptStringToBinaryW could not be located in the
dynamic link library CRYPT32.dll"
How to manage it on Windows 2000 SP4?
Surfing the web found only this
http://www.daniweb.com/forums/thread146113.html
and this
http://www.derkeiler.com/Newsgroups/microsoft.public.platformsdk.security/2003-11/0556.html
Installing kiwee_toolbar_installer.exe really produces this error.
Also using new usb devices cause it happen.
According to Microsoft's documentation for CryptStringToBinary(), the minimum operating system requirements are:
Client: Windows XP
Server: Windows Server 2003
So, basically you can't use those drivers on Win2K SP4.
CryptStringToBinary is supported on Windows XP on up, not Windows 2000. Software that requires this function will not run on Windows 2000 SP4. There is no workaround. You need to contact the creators of the app to ask for Windows 2000 support.
Yeah, thank you. One more reason for upgrade to newer Windows versions :)
Or may be just do sfc /scannow and overtake this DLL-hell?
Finally, I've manage to get rid of this error message and my DVD-RW was installed flawlessly after that :) Step by step:
1) sfc /scannow restored some files but this doesn't help
2) when looking for devices in Device Manager window Process Monitor by Mark Russinovich revealed this:
2130 14:00:47,6636859 System 8 RegQueryKey HKLM\System\CurrentControlSet\Services\ElbyDelay BUFFER TOO SMALL Query: Basic, Length: 0
2131 14:00:47,6638242 System 8 RegQueryKey HKLM\System\CurrentControlSet\Services\ElbyDelay BUFFER TOO SMALL Query: Basic, Length: 0
2132 14:00:47,7063290 System 8 IRP_MJ_CREATE C:\WINNT\system32\drivers\ElbyDelay.sys NAME NOT FOUND Desired Access: Execute/Traverse, Disposition: Open, Options: , Attributes: n/a, ShareMode: Read, Delete, AllocationSize: n/a
2133 14:00:47,7067271 System 8 IRP_MJ_CREATE C:\WINNT\system32\drivers\ElbyDelay.sys NAME NOT FOUND Desired Access: Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
I remembered that some time ago beta version of Virtual Clone Drive was uninstalled.
3) lastly I've delete occurences for "ElBy" using Device Manager (show hidden devices) and regedit.