Skip to main content
Inspiring
November 16, 2018
Question

Printing certificate with javascript problems

  • November 16, 2018
  • 1 reply
  • 283 views

I have a course completion certificate that allows the user to enter their name and the course name in text input fields.The text entered is assigned to variables that are used to create a printable certificate on another slide.  Clicking my Print button jumps to that slide. On entering the slide I execute the Javascript "window.print()" command which opens the printer dialog to print a hard copy.  The Captivate will be published in HTML5 only.

Problem 1: the printer dialog opens before the slide contents are fully loaded. So the only thing that prints is a background image - not user name and course name.

Problem 2: the slide image is smaller than it should be and pushed to the right edge of the page with a lot of blank space on the left.

I thought of somehow trying to trigger the print action later in the timeline after slide contents finish rendering but there doesn't seem to be any action that can be triggered that way - at a certain time or when an object loads.  As to the scaling problem, Scale to Fit when publishing doesn't help.  I don't know if there is a way to do it with Javascript.

Anybody know of fixes for this?

    This topic has been closed for replies.

    1 reply

    David Burnham HBA
    Inspiring
    November 16, 2018

    I chose not to try and print from Captivate years ago - 

    I create a link to a fillable PDF where the learner can type in their name and print the PDF certificate.