Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Print to TIFF
Message
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Title:
Environment versions
OS:
Windows Server 2003
Database:
MS SQL Server
Miscellaneous
Thread ID:
01534868
Message ID:
01535869
Views:
47
>>We need to print multiple reports silently to a tiff in a specified location on the network.
>>MODI: Cannot find a way to make it go to file silently (without asking for location)
>>
>>VFP Report Listener: It outputs to 100 dpi and the output is not acceptable at this setting. Cannot figure out how to change that.
>>
>>XFRX: Using demo prints nicely but the file is huge and too slow on our production mapped drive. We can change the dpi but the bit depth setting doesn't affect anything which we believe should allow us to along with dpi control file size. Have E Mailed eques no response yet.
>>
>>FRX2any: Can't see a way to control any thing that might affect file size.
>>
>>Any suggestions would be appreciated.
>
>XFRX never responded to any E Mails.
>FRX2Any responded with some work on fixes but we needed a solution last week so we continued with Modi
>
>
>We finally solved all of our problems using modi. Here is the code below we came up with:
>
>
>    DECLARE INTEGER GetDefaultPrinter IN winspool.drv;
>       STRING  @ pszBuffer,;
>       INTEGER @ pcchBuffer
>
>    DECLARE INTEGER SetDefaultPrinter IN winspool.drv;
>       STRING pszPrinter
>
>     *---------------------------------------------------------------
>      *-- Set Default Windows Printer to MODI
>      *---------------------------------------------------------------
>      nBufsize = 250
>      cPrinter = REPLICATE(Chr(0), nBufsize)
>      = GetDefaultPrinter(@cPrinter, @nBufsize)
>      cOldPrinter = SUBSTR(cPrinter, 1, AT(Chr(0),cPrinter)-1)
>      = SetDefaultPrinter("Microsoft Office Document Image Writer")
> 
>      *---------------------------------------------------------------
>      *-- Set OpenInMODI reg value to 0
>      *---------------------------------------------------------------
>      oShell = CREATEOBJECT("wscript.shell")
>      nOldOpenInMODI = 0
>      TRY 
>         nOldOpenInMODI = oShell.RegRead("HKCU\Software\Microsoft\Office\12.0\MODI\MDI writer\OpenInMODI")
>      CATCH 
>      ENDTRY 
>      oShell.RegWrite("HKCU\Software\Microsoft\Office\12.0\MODI\MDI writer\OpenInMODI", 0, "REG_DWORD")
>     
>      *---------------------------------------------------------------
>      *-- Save the SOA reports to the specified destionation folder
>      *---------------------------------------------------------------       
>      IF lPrintDet
>         SELECT csNonCovList1
>         REPORT FORM 'Non_Det' TO FILE (cFileNameDet + cExt)
>      ENDIF
>            
>      IF lPrintSumm
>         SELECT csNonCovList2
>         REPORT FORM 'Non_Summ' TO FILE (cFileNameSum + cExt)
>      ENDIF 
>
>      *---------------------------------------------------------------
>      *-- Set OpenInMODI reg value back to what it initially was
>      *---------------------------------------------------------------
>      oShell.RegWrite("HKCU\Software\Microsoft\Office\12.0\MODI\MDI writer\OpenInMODI", nOldOpenInMODI, "REG_DWORD")
>                  
>      *---------------------------------------------------------------
>      *-- Set Default Windows Printer back to what it initially was
>      *---------------------------------------------------------------            
>      = SetDefaultPrinter(cOldPrinter)
>
Let me add that you may not need to write to the registry.
MODI allows SAVEAS to the format you need. Like:
PROCEDURE iConvertTIF2MDI

oMoDI = Createobject('MODI.Document')
oMoDI.Create("c:\yy.tif")
ERASE c:\yy.mdi
miFILE_FORMAT_MDI=4
oMoDI.SaveAs("c:\yy.mdi", miFILE_FORMAT_MDI)
oMoDI.Close(.t.)
Good Luck
Previous
Reply
Map
View

Click here to load this message in the networking platform