Today in this post i will walkthrough how we can convert any MS Office File into PDF.
It have been many time required to convert any attached file with the record in Navision to PDF format.
To perform this action we will require a tool which can be downloaded from:
OfficeToPDF download link :- http://officetopdf.codeplex.com/releases/view/118190
Extract and save the OfficeToPDF.exe file to some Folder.
For this Walkthrough i have created a Field in Customer Table to save the File Path of the Office File which we want to convert into PDF.
You can add Dialog box to select the File from the specified Folder.
For this demo i have kept it simple Text Field where you can add your File Path and Office File Name. It is assumed that only Office File will be attached here.
For Setup purpose i have created one Setup Table & Page where we will store our other required Folder paths.
Here we have given provision to save the Path of the Office to PDF Convertor Tool file Path & Temporay working Folder.
I have used the shared folder for all the paths so that it is not system specific, also make sure you give required permission on this folder for all the operating accounts.
Now our Next task will be to write a function which will perform this conversion part.
Above Function Takes the File Name from the Customer Card we stored above on Customer Card. Takes the Path of the Office To PDF Convertor Utility and Tmp working Folder.
Prepares the PDF file Name along with Path stored in Setup.
Prepares the command to invoke Convert Utility using WsShell and returns the PDF file File Name along with path as defined in the Setup.
Now you can use this File for futher purpose as required.
To keep it simple no additional code of test and other required routine task is not added.
Now you know the Logic you can tweak the functionality as per your requirement.
I will comeup with more information in my up comming posts, till then keep exploring and learning.
2 thoughts on “Converting Office Files into PDF from Navision”
Comments are closed.