Showing posts with label WCF RIA. Show all posts
Showing posts with label WCF RIA. Show all posts

Tuesday, July 19, 2011

Converting Text file to PDF and TIFF without "Save As" dialogue

As a part of Systems Architect job, you got unique client request almost daily.

In my case client wanted to convert text file to PDF and TIFF file. After conversion they wanted to load into Quantum software.
 
Most of the hospital lab result from PISCAS and other software's were in HL7 Messages and also ASCII text file format but to store in Quantum files must be converted to PDF or TIFF, It was necessary step to convert to PDF or TIFF.

After doing some research i got interesting idea for conversion. Instead of using third part converters, I used standard printer drivers and Word Pad.

I used the following tools

1) Word Pad
2) PDF printer driver
3) "Microsoft Office Document Image Writer" printer driver






I used following command to convert files.

C:\>wordpad.exe /pt "SourceFileName&Path" "TargetPrinterDriver"

/pt is for silent conversion.

"Microsoft Office Document Image Viewer" Silent Mode:

Please change the following Registery of Settings "MyComputer\HCU\Softwares\Microsoft\Office\12.0\MODI\MDI writer" for "Microsoft Office Document Image Viewer"  in order to convert file in silent mode.
 
 
 
 
There are two important settings are OpenInMODI and PrivateFlags.
OpenInMODI should be "0" but remember sometime you need to assign decimal 0 value manually.
PrivateFlags should be 11 in Hexa decimal and data should show (17)

"Acorbat PDF Converter" Silent Mode:
For Adobe silent mode conversion you need to change the printer driver settings. Click on the printer and then click on select printing preference (Xp)
 

Change the Adode PDF output folder to MyDocument\*.pdf or browse your own folder.


  Once you are done click "ok"

Following command will convert the file in silent mode


C:\>"C:\Program Files\Windows NT\Accessories\wordpad.exe" /pt C:\admit.txt "Microsoft Office Document Image Writer"


C:\>"C:\Program Files\Windows NT\Accessories\wordpad.exe" /pt C:\admit.txt AdobePDF

By default all files will be generated in the "My Document" Folder  until you change it in the settings.


Some interesting post i discover

Really nice file conversion online utility:
http://www.freefileconvert.com/



Some useful links for file conversion:

http://www.robvanderwoude.com/commandlineswitches.php#XpsViewer

http://social.msdn.microsoft.com/Forums/en/isvvba/thread/c5ae166b-84d0-4de7-b65f-b50cca8b3b32

http://www.robvanderwoude.com/printfiles.php

Wednesday, May 12, 2010

Cache database linked to Sql server with Silverlight 4.0 and WCF RIA

This is interesting project, We have a Cache Database for specific application and the database design and control was proprietary for this application. We were allowed to used the data but no modification were allowed on the server. After carefully review of the situation I came up with the idea to add a cache database linked with sql server.. Linking to SQL Server gave us three fundamental advantages..

1) Writing SP's in SQL Server while utilizing data from Cache database.
2) Writing Views
3) No changes in the Cache database.

After successfully linked with cache database we built the application on state of the art platform Silverlight 4.0 and WCF RIA Services.