Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Truncating pdf

We regularly use oipi to send reports directly to pdf usually for attaching to an email.
We've recently had a customer bring to our attention that when they are sending a pdf with a batch of reports the pdf doesn't always contain the entire batch.
The simplest example is when emailing a customer an invoice. That works fine. Invoice prints direct to a pdf and attaches to the email. However, if they are running the same process but this time the pdf is to contain say 25 invoices, all 25 may or may not be included. The pdf seems to truncate at some arbitrary point. Maybe 10 invoices, maybe 12, maybe 21. The point is not consistent other than it is at the end of a completed invoice (which is effectively a print job).
I know that all invoices are being processed and sent to the printer, it just seems the pdf is terminating before it receives them all.
There is one set_printer("TERM") statement at the end of the batch job. That statement may take 30 seconds to execute and returns a successful status.

My guess is that the issue has something to do with printer spooling and the execution of the term just ends everything wherever the printer was up to. My problem is I don't know what to do to address that.

Any suggestions cause I've about exhausted my ideas and


Comments

  • Just so I'm clear, are you printing to a PDF driver or are you using the OIPI to export to PDF format?
  • Using OIPI to export to pdf.
    It doesn't matter if we send the output directly to pdf via the export format in the INIT statement or if we print preview then use the export option on the preview screen.
    Both methods exhibit the same symptoms
  • We find similar issues with PDF generation from OIPI v1 (not the .net version), especially if the reports include images. I presume its a memory issue within OIPI on the workstation. We tell people to Print to a PDF driver if they are getting these issues.
  • We do a fair amount of OIPI printing as well and I can't recall seeing this before. Thus, I'm still trying to gather clues. I'm assuming that when you are missing invoices, it is always the invoices at the end rather than random invoices within the middle of the list.

    Offhand I concur that something just seems to give up and the output is no longer being captured. We have seen a similar problem when the output destination of for the PDF is being monitored by another process. In one case we recently dealt with, an FTP process was constantly waiting for the PDF file so it could send it elsewhere. Well, if the PDF output was big enough, the file was still being generated when the FTP process identified the file and moved it...thus truncating the PDF before it could be finished.

    We worked around the problem by routing the PDF to a Windows temp folder first and then move the file to the final destination after it was done. Perhaps some kind of AV scan is interfering in a similar way.
  • IIRC we were getting missing pages, not necessarily at the end. The reports were not necessarily one record per page so it was possible to get truncated or merged records within the report. It appeared to be a problem specifically with the page generation.
  • We too do copious amounts of oipi printing and haven't come across this before and I'd like to think that it would have been mentioned if it had. With the invoicing example, that was written four years ago and it's used several times a week and I know they wouldn't allow themselves to be short-changed by missing invoices. That thinking led me to wanting to point the finger at the client environment but then I came home and tried it and replicated the same issue.
    So different workstations. different networks. different printers and therefore printer drivers.

    Can confirm that it is just pages at the end rather than random missing pages.
  • I can't find that particular issue now. We recall an instance where the first page was numbered page 5!

    But have another example where images were no longer being shown at some point in the report although the text was still output. That's more indicative of a memory issue.
  • @AusMarkB did you note whether this is OIPI classic or OIPI.Net? Have you tried switching it to see if the problem is consistent?
  • Ok, I've just replicated the exact same report on two different workstations, both with the same intermediate pages missing, but with one missing an extra page.

    Interesting that when you look in the local Windows Temp folder while the PDF is being generated, there is Pg(n).emf temporary file as it works on page n.
  • @DonBakke or anyone else, can you confirm how to switch between classic and .Net?
    It's my recollection that you switch the content of the vsprinter record in sysenv between vsprinter and vsprinter2 or have I oversimplified?

    If that is all you do then I was on classic and switching to vsprinter2 made no difference.
  • @AusMarkB yes, that's all you need to do. However, you should confirm that you did it right by doing a preview of a report and confirming that you see the newer form. When I want to do a quick sanity check with the OIPI, I just open a dictionary in the Table Builder and do a print from there.
  • Thanks Don.
    I used your sanity check and just got the same print preview as always.
    How can I get it wrong?


  • You are changing the wrong Key ID in SYSENV. I assumed you were using the right none, but now I see that your previous post didn't specify which Key ID it was. Try CFG_OIPI.
  • Well it did specify but easily overlooked because of what it actually was. That's what I meant by
    the content of the vsprinter record
    but I can understand how that could be glossed over as a description rather than the key.

    So,
    all invoices printed in the pdf.
    But and there always is one....

    nothing fits to the page now so in this example, forty odd invoices are spread over 88 pages.
    Probably why we're still on classic oipi. Too much work to check all report fonts and alignments.
  • Yes, unfortunately that is a big reason why tons of reports have not been converted for many developers (you should try converting to the BRW...)

    So this does narrow the field a bit. You might want to try printing to a PDF printer driver instead. This could end up being your workaround but at the very least it will absolutely point the finger at VSPDF.ocx if this method works...so this might also help you troubleshoot the problem also.
  • and if I print preview, they all print to the screen, I watch them appearing and then as soon as it's finished, the preview screen flashes and then all I'm left with is a single blank page with the window title saying "Dictionary Listing Print Prevew for thenameofthetableIprintedforyoursanitycheck"
  • I'm not sure I followed your previous post. Are you noting that something else is amiss but with the OIPI.Net preview window? If so, make sure you have the latest client setup installed.
Sign In or Register to comment.