Auto-Print of PDF

Discussions about PDF management.
Post Reply
ULimper
Posts: 13
Joined: Wed Oct 10, 2012 2:26 pm

Auto-Print of PDF

Post by ULimper » Mon Nov 12, 2012 2:13 pm

Hi,

is it possible to create a PDF that asks the user automatically with a print dialog after opening? Or is there any other possiblilty to auto-print a PDF generated as a stream?

Thanks,
Uli

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Auto-Print of PDF

Post by Loïc » Tue Nov 13, 2012 10:27 pm

Hello,

Yes it possible to do that is by using our latest version.

Basically what you have to do is:

- Create a javascript action
- Set the created action in the doc open trigger.

Here a basic example:

Code: Select all

        Using oGdPicturePDF As New GdPicturePDF
            If oGdPicturePDF.LoadFromFile("c:\test.pdf", True) = GdPictureStatus.OK Then
                oGdPicturePDF.SetViewerOpenAction(oGdPicturePDF.NewActionJavaScript("this.print();"))
                oGdPicturePDF.SaveToFileInc("c:\test.pdf")
            End If
        End Using
Let me know if you need clarifications.

With best regards,

Loïc
End Using

ULimper
Posts: 13
Joined: Wed Oct 10, 2012 2:26 pm

Re: Auto-Print of PDF

Post by ULimper » Wed Nov 14, 2012 8:54 am

Hi,

thanks, works perfect (but not in PDF-A, but I assume that is a "feature" of PDF-A)

Thanks,
Uli

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests