Print2eDoc SDK
SDK for document conversion to PDF, PNG, JPEG, TIFF...
Compatibility
VB VB.NET VC++ C# Delphi

How To Create PDF Forms With Microsoft Word

Learn how to convert form fields in Word documents to PDF form fields using Print2eDoc SDK.
By Mallika K.
Important

This product has been discontinued. Please check our old products page for more information.

In the latest version of Print2eDoc SDK, we introduced a feature that allowed easy conversion of form fields in Microsoft® Word™ documents to PDF form fields.

Taking advantages of this, you can design your PDF forms (AcroForms) document in Microsoft Word and create them using Print2eDoc SDK.

In this article, we will see a code snippet that illustrates the ease with which the conversion can be done.

' Create a new gtPrint2eDoc object
Dim PrinterObj As New gtPrint2eDoc
PrinterObj.ActivateLicense "AuthKey"

' Specify conversion settings
PrinterObj.KeepOfficeApplicationsOpen = False
PrinterObj.DefaultOutputDirectory = "C:\"
PrinterObj.OutputDocumentName = "output_doc"
PrinterObj.ShowPreview = False
PrinterObj.ShowSaveDialog = False
PrinterObj.ShowSettingsDialog = False
PrinterObj.ViewGeneratedDocuments = True

' Specify output format as PDF
PrinterObj.OutputDocumentFormat = TxgtDocumentFormat.PDF


' Specify Office Add-In settings
With PrinterObj.OfficeAddinSettings
 .WordDocumentPropertiestoDocumentInfo = True
 .WordBookmarksToBookmarks = True
 .WordCommentsToPDFNotes = True
 .WordHeadingsToBookmarks = True
 .WordHiddenBookmarksToBookmarks = False
 .WordHyperlinksToLinks = True
 .WordLinkBorderColor = RGB(0, 0, 255)
 .WordNotesColor = RGB(0, 255, 0)

 ' Enable Word form fields conversion to PDF 
 .WordFormFieldsToPDFFormFields = True 
 ' Specify Word form fields conversion settings 
 .WordFormFieldBorderColor = RGB(0, 0, 255)
 .WordFormFieldBackgroundColor = RGB(0, 255, 0)
End With


' Convert Word document using Office Add-In
PrinterObj.PrintWordDocument("c:\input_doc.doc")

This code converts a Word document at c:\input_doc.doc that contains form fields. The highlighted properties of the Office Add-In object are new in the latest version of Print2eDoc SDK. They allow you to enable conversion of form fields, and set border and background colors of the converted form fields.

When the form fields in the Word document are converted, the following properties are retained in the converted PDF document:

Privacy | Legal | Feedback | Newsletter © 2002-2010 Gnostice Information Technologies Private Limited. All rights reserved.

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.