Print2eDoc SDK
SDK for document conversion to PDF, PNG, JPEG, TIFF...
Compatibility
Performing E-Mail, FTP and Newsgroup Post Tasks In Print2eDoc SDK
Use document profile settings to specify finishing tasks, such as e-mailing or FTP uploading output files, which are to be performed immediately after each conversion job is over.
By Shivaranjini M.
Important
This product has been discontinued. Please check our old products page for more information.
Gnostice Print2eDoc uses document conversion profiles to store settings used to convert documents from one format to another. The document creation profiles also support certain post-conversion finishing tasks such as e-mailing to a list of recipients, uploading to an FTP site, and posting to a newsgroup.
This tip is about performing these finishing tasks entirely through code, using Gnostice Print2eDoc SDK.
Here is the code snippets in Visual Basic and C#. Code explanations are provided as comments.
E-mail
======
Dim PrinterObj As gtPrint2eDoc
Dim message(5) As String
'Creates a Print2eDoc printer object
Set PrinterObj = New gtPrint2eDoc
message(0) = "Hi!"
message(1) = "This is an e-mail test."
message(2) = "With a converted document attached."
message(3) = "Regards"
message(4) = "Print2eDoc SDK"
'Modifies the current profile to automatically
e-mail converted documents
With PrinterObj.CurrentProfile
'Ensures that converted document is
'e-mailed to specified recipients
.EmailAfterCreate = True
.EmailBody = message
.EmailFrom = "user@somewebsite.com"
.EmailMethod = DirectSMTPServer
.EmailSendSilently = True
.EmailSMTPAuthRequired = True
.EmailSMTPPassword = "password"
.EmailSMTPUserId = "user"
.EmailSMTPServerName = "192.168.10.10"
.EmailSMTPServerPort = "25"
.EmailSubject = "E-mail test for Print2eDoc SDK"
.EmailTo = "a@somewebsite.com, d@somewebsite.com"
.EmailCC = "b@somewebsite.com"
.EmailBCC = "c@somewebsite.com"
End With
'Sets the modified profile as current profile,
'converts a document, and automatically
'e-mails output document to the recipients
PrinterObj.OutputDocumentName = "OutputPDF"
PrinterObj.OutputDocumentFormat = _
TxgtDocumentFormat.PDF
PrinterObj.ApplyChangesToCurrentProfile
PrinterObj.PrintDocument("input.doc")
NNTP
====
Dim PrinterObj As gtPrint2eDoc
Dim message(5) As String
'Creates Print2eDoc printer object
Set PrinterObj = New gtPrint2eDoc
message(0) = "Hi!"
message(1) = "This is a newsgroup post test"
message(2) = "With a converted document attached."
message(3) = "Regards"
message(4) = "Print2eDoc SDK"
'Modifies current profile to automatically
'post converted files to a newsgroup
With PrinterObj.CurrentProfile
'Ensures that converted document is
'posted to specified newsgroup
.NNTPAfterCreate = True
.NNTPUserName = "user"
.NNTPPassword = "password"
.NNTPServerName = "192.168.10.1"
.NNTPServerPort = 9119
.NNTPReplyTo = "user@somewebsite.com"
.NNTPSubject = "Newsgroup post test for Print2eDoc SDK"
.NNTPFrom = "user@somewebsite.com"
.NNTPNewsGroups = "somewebsite.private.temp"
.NNTPBody = message
End With
'Sets the modified profile as current profile,
'converts a document, and automatically
'posts output document to the newsgroup
PrinterObj.OutputDocumentName = "OutputPDF"
PrinterObj.OutputDocumentFormat = TxgtDocumentFormat.PDF
PrinterObj.ApplyChangesToCurrentProfile
PrinterObj.PrintDocument ("input.doc")
FTP
===
Dim PrinterObj As gtPrint2eDoc
'Creates Print2eDoc printer object
Set PrinterObj = New gtPrint2eDoc
'Modfies the current profile to automatically
'upload converted documents to a FTP site
With PrinterObj.CurrentProfile
'Ensures that converted document is
'upload to specified FTP site
.FTPAfterCreate = True
.FTPPassword = "password"
.FTPUserName = "user"
.FTPServerName = "192.168.10.30"
.FTPDestinationDirectory = "\FTPFolder"
.FTPUsePassiveTransfer = True
End With
'Sets the modified profile as current profile,
'converts a document, and automatically
'uploads output document to the FTP site
PrinterObj.OutputDocumentName = "OutputPDF"
PrinterObj.OutputDocumentFormat = TxgtDocumentFormat.PDF
PrinterObj.ApplyChangesToCurrentProfile
PrinterObj.PrintDocument ("input.doc")
|
E-mail
======
IgtPrint2eDoc PrinterObj;
gtProfileSettingsX ProfileObj;
// Creates Print2eDoc printer object
PrinterObj = new gtPrint2eDocClass();
// Retrieves a reference to current profile settings
ProfileObj = PrinterObj.CurrentProfile;
// Ensures that converted document is
// e-mailed to specified list of recipients
ProfileObj.EmailAfterCreate = true;
// Modfies the profile to automatically
// e-mail converted documents to the recipients
ProfileObj.EmailMethod = TxgtEmailMethod.DirectSMTPServer;
ProfileObj.EmailFrom = "a@somewebsite.com";
ProfileObj.EmailTo = "b@somewebsite.com";
ProfileObj.EmailBCC = "cb@somewebsite.com";
ProfileObj.EmailCC = "d@somewebsite.com";
ProfileObj.EmailSubject = "E-mail test for Print2eDoc SDK";
string [] str = {"Hi!",
"This is an e-mail test.",
"Regards",
"Print2eDoc SDK"};
ProfileObj.EmailBody = (object)str;
ProfileObj.EmailMethod = TxgtEmailMethod.DirectSMTPServer;
ProfileObj.EmailSMTPAuthRequired = true;
ProfileObj.EmailSMTPPassword = "user";
ProfileObj.EmailSMTPServerName = "192.168.10.10";
ProfileObj.EmailSMTPServerPort = 25;
ProfileObj.EmailSMTPUserId = "password";
// Sets the modified profile as current profile,
// converts a document, and automatically
// e-mails output document to the recipients
PrinterObj.ApplyChangesToCurrentProfile();
PrinterObj.OutputDocumentName = "Output";
PrinterObj.OutputDocumentFormat = TxgtDocumentFormat.PDF;
PrinterObj.ApplyChangesToCurrentProfile();
PrinterObj.PrintDocument("input.doc");
NNTP
====
IgtPrint2eDoc PrinterObj;
gtProfileSettingsX ProfileObj;
// Creates Print2eDoc printer object
PrinterObj = new gtPrint2eDocClass();
// Retrieves a reference to current profile settings
ProfileObj = PrinterObj.CurrentProfile;
// Ensures that converted document is
// posted to specified newsgroup
ProfileObj.NNTPAfterCreate = true;
// Modifies the profile to automatically
// post converted documents to the newsgroup
ProfileObj.NNTPAuthRequired = true;
ProfileObj.NNTPFrom = "a@somewebsite.com";
ProfileObj.NNTPNewsGroups = "somewebsite.private.temp";
ProfileObj.NNTPReplyTo = "a@somewebsite.com";
ProfileObj.NNTPServerName = "192.168.10.10";
ProfileObj.NNTPServerPort = 9119;
ProfileObj.NNTPSubject =
"Newsgroup post test for Print2eDoc SDK";
ProfileObj.NNTPUserName = "user";
ProfileObj.NNTPPassword = "password";
string [] str = {"Hi!",
"This is a newsgroup post test.",
"Regards",
"Print2eDoc SDK"};
ProfileObj.NNTPBody = str;
// Sets the modified profile as current profile,
// converts a document, and automatically
// posts output document to the newsgroup
PrinterObj.OutputDocumentFormat = TxgtDocumentFormat.PDF;
PrinterObj.OutputDocumentName = "Output";
PrinterObj.ApplyChangesToCurrentProfile();
PrinterObj.PrintDocument("input.doc");
FTP
===
IgtPrint2eDoc PrinterObj;
gtProfileSettingsX ProfileObj;
// Creates Print2eDoc printer object
PrinterObj = new gtPrint2eDocClass();
// Creates a profile with current profile settings
ProfileObj = PrinterObj.CurrentProfile;
// Modfies the profile to automatically
// upload converted documents to a FTP site
ProfileObj.FTPAfterCreate = true;
ProfileObj.FTPDestinationDirectory = "\\FTPFolder";
ProfileObj.FTPServerName = "192.168.10.10";
ProfileObj.FTPUsePassiveTransfer = true;
ProfileObj.FTPUserName = "user";
ProfileObj.FTPPassword = "password";
// Sets the modified profile as current profile,
// converts a document, and automatically
// uploads output document to the FTP site
PrinterObj.OutputDocumentFormat = TxgtDocumentFormat.PDF;
PrinterObj.OutputDocumentName = "Output";
PrinterObj.ApplyChangesToCurrentProfile();
PrinterObj.PrintDocument("input.doc");
|
This site is best viewed on a screen with minimum resolution of 1152 x 864 pixels.
Windows users are advised to use Microsoft ClearType Tuning for optimal experience.
Linux and other users can enable font smoothing, as supported by their OS.
Also, please use the latest version of a standards-compliant browser such as Opera, FireFox, Chrome or Safari.