Operating System - OpenVMS
1753974 Members
7637 Online
108811 Solutions
New Discussion юеВ

Re: "Printing" reports to PDF file

 
SOLVED
Go to solution
Wim Van den Wyngaert
Honored Contributor

Re: "Printing" reports to PDF file

Enclosed the script to mail files. Could be of use too.
Note that this requires modification to run on your site (logicals ops&, txt2pdf in my version and BNT stuff replaced, ...).

Wim
Wim
Jan van den Ende
Honored Contributor

Re: "Printing" reports to PDF file

@Craig:

My guess about your difficulty uploading (and other's downloading) is that it might be to do with the file TYPE.

Most browsers try to make conclusions about the way to handle specific downloads by their file type.

USUALLY (but without guarantee!) a source file can better be renamed to .TXT, and than renamed back on VMS.
This certainly also applies for .COM files.

hoping to have been of some help,

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.

Re: "Printing" reports to PDF file

Thank you all again... Oswald's solution is not building correctly on my VAX, probably more to do with my environment that the code itself...

Going to next try Wim's and Craig's solutions to see if I can get either one working... Trick is, I have the next 2 days off before the kids start school on Wednesday, so may not get to try them til them.

Re: "Printing" reports to PDF file

OK, I got Craig's version (of Phil Smith's) TEXT2PDF working and properly creating a working PDF file.

I am currently working with Wim's script but just found out mime.exe was released with V7.2. I, of course, am stuck on v7.1 for the forseeable future. I am currently working on this (found a few different possible applications) to see which will work here.

Thank you all once again.
Hoff
Honored Contributor

Re: "Printing" reports to PDF file

Look to mpack and munpack or such; the standard MIME tools are an option (where available), but various folks can find these and other similar MIME tools a better choice. Yes, even when the MIME tool is available.

Here's one port:

http://mvb.saic.com/freeware/freewarev50/mpack15/

There may be a newer port around.

Re: "Printing" reports to PDF file

Thanks for that Hoff... I was just working with that application.

I'm also pushing FTPing the files to our file server since many of these are printed to be archived anyway. As soon as I can convince him it was his idea, I think it will done. :)

Re: "Printing" reports to PDF file

Reopening to try and see if someone (Craig???) can help with a small problem I see with the text2pdf.c program that Craig provided earlier in this thread. I have tried contacting the original author using several different email addresses I have found, but they all appear to be bouncing. If you have an alternate contact for Phil (or can point him here), that would work as well.

BTW, I am currently having the converted files FTP'd to the file server and things are working quite well.

Now the problem... If there are more than 1861 pages to be converted, the PDF file can not be read beyond that page. The data is there with no problem, but the pdf formatting at the footer of the file is not wrapping correctly after the second line. If I wrap the /Kids section by hand, the file will work properly. It appears the first line wraps fine almost by accident because of the spaces but the secont line breaks in the middle of a number (5586 for the first failure). If there were a way to wrap if within x characters of the page width or (less elegantly) to wrap after each entry, that would work. Currently the characters seem to wrap around 10000 (did not count them beyond 1000) characters.

The section of code is in the
void WriteRest() section:

writestr("/Kids [ ");
for (i = 1; i <= pageNo; i++) {sprintf(buf, "%d 0 R ", pageObs[i]); writestr(buf);}
writestr("]\n");


Any ideas?
Hoff
Honored Contributor

Re: "Printing" reports to PDF file

Here, you can fix the C code to wrap the section correctly, run some tests with your existing test suite of files, and contribute it back out to the community.

Or you could run some post-processing DCL that fixes this formatting error.

Or you can pay somebody to tweak the code. You're almost certainly making commercial use of this code, so toss a couple of hundred bucks into a bounty for a fix, for instance.

As for the official specs and the approach involving fixing the code, the Adobe PDF specs (aka ISO 32000) are available.

http://www.adobe.com/devnet/pdf/pdf_reference.html

http://www.adobe.com/devnet/acrobat/pdfs/adobe_supplement_iso32000.pdf

Or use this as an opportunity to add to your own existing C coding skills and to add to your own resume; to do a little C coding -- you've apparently localized this error down to the particular source code involved, after all. Switch this over to a "how do I do [line-wrapping?] using [printf?] for [desired outcome?] question, for instance.

Re: "Printing" reports to PDF file

Hoff: Thanks to your first link, I saw that those /Kids entries could each be on a separate line (in fact that is how they are all shown in the documentation for 1.3).

I placed a "/n" on the line after 0 R and now that part should work for any sized file. Anything beyond that small change would have meant getting someone else involved. I was able to track down the code segment only because of all the fixed text and following the program through. Still don't understand how lots of it works.

As far as getting the change pushed out to the rest of the community, I would like to let Phil Smith, the original author, know but have been unable to contact him and I don't even see the version Craig provided in this thread published anywhere else. V1.2 was provided here, all I find is v1.1 on the web.

Re: "Printing" reports to PDF file

Correction... that should be a \n to make the line:

writestr("/Kids [ ");
for (i = 1; i <= pageNo; i++) {sprintf(buf, "%d 0 R \n", pageObs[i]); writestr(buf);}
writestr("]\n");