home *** CD-ROM | disk | FTP | other *** search
/ Corel Draw 6 / corel-draw-6-cd1.iso / draw / printd.csc < prev    next >
Text File  |  1995-08-18  |  5KB  |  188 lines

  1. REM Draw Mass Print Utility v1.0
  2. REM Printd.csc July 19, 1995 
  3.  
  4. REM This file will open, print and close all of the specified files in a directory.
  5. DECLARE SUB PrintImage(filename$)
  6.  
  7. ' Following are all filter types with descriptions, filenames, and extensions
  8. DIM FilterName(45) AS STRING
  9. DIM FilterExt(45) AS STRING
  10. DIM FilterType(45) AS LONG
  11.  
  12. FilterName(1) = "PostScript Interpreted (PS)"
  13. FilterExt(1) = "PS"
  14. FilterType(1) = 1290
  15. FilterName(2) = "GEM File (GEM)"
  16. FilterExt(2) = "GEM"
  17. FilterType(2) = 1284
  18. FilterName(3) = "Corel Presentation Exchange (CMX)"
  19. FilterExt(3) = "CMX"
  20. FilterName(4) = "Computer Graphics Metafile (CGM)"
  21. FilterExt(4) = "CGM"
  22. FilterType(4) = 1280
  23. FilterName(5) = "AutoCad (DXF)"
  24. FilterExt(5) = "DXF"
  25. FilterType(5) = 1296
  26. FilterName(6) = "OS/2 PM Metafile (MET)"
  27. FilterExt(6) = "MET"
  28. FilterType(6) = 1291
  29. FilterName(7) = "Macintosh Pict (PCT)"
  30. FilterExt(7) = "PCT"
  31. FilterType(7) = 1288
  32. FilterName(8) = "IBM PIF (PIF)"
  33. FilterExt(8) = "PIF"
  34. FilterType(8) = 1285
  35. FilterName(9) = "WordPerfect Graphics (WPG)"
  36. FilterExt(9) = "WPG"
  37. FilterType(9) = 1287
  38. FilterName(10) = "Corel Metafile (CMF)"
  39. FilterExt(10) = "CMF"
  40. FilterType(10) = 1295
  41. FilterName(11) = "Windows Metafile (WMF)"
  42. FilterExt(11) = "WMF"
  43. FilterType(11) = 1294
  44. FilterName(12) = "Encapsulated PostScript (EPS)"
  45. FilterExt(12) = "EPS"
  46. FilterType(12) = 1289
  47. FilterName(13) = "Lotus Freelance (PRE)"
  48. FilterExt(13) = "PRE"
  49. FilterType(13) = 1549
  50. FilterName(14) = "HPGL Plotter File (PLT)"
  51. FilterExt(14) = "PLT"
  52. FilterType(14) = 1281
  53. FilterName(15) = "Adobe Illustrator (AI)"
  54. FilterExt(15) = "AI"
  55. FilterType(15) = 1283
  56. FilterName(16) = "Corel Draw! (CDR)"
  57. FilterExt(16) = "CDR"
  58. FilterType(16) = 1795
  59. FilterName(17) = "JPEG Bitmaps (JPG)"
  60. FilterExt(17) = "JPG"
  61. FilterType(17) = 774
  62. FilterName(18) = "Windows Bitmap (BMP)"
  63. FilterExt(18) = "BMP"
  64. FilterType(18) = 769
  65. FilterName(19) = "Paintbrush (PCX)"
  66. FilterExt(19) = "PCX"
  67. FilterType(19) = 770
  68. FilterName(20) = "Targa Bitmap (TGA)"
  69. FilterExt(20) = "TGA"
  70. FilterType(20) = 771
  71. FilterName(21) = "Scitex CT Bitmap (SCT)"
  72. FilterExt(21) = "SCT"
  73. FilterType(21) = 776
  74. FilterName(22) = "CompuServe Bitmap (GIF)"
  75. FilterExt(22) = "GIF"
  76. FilterType(22) = 773
  77. FilterName(23) = "TIFF Bitmap (TIF)"
  78. FilterExt(23) = "TIF"
  79. FilterType(23) = 772
  80. FilterName(24) = "Corel PhotoPaint Image (CTP)"
  81. FilterExt(24) = "CPT"
  82. FilterType(24) = 1792
  83. FilterName(25) = "Windows 3.x/NT Icon Resource (ICO)"
  84. FilterExt(25) = "ICO"
  85. FilterType(25) = 785
  86. FilterName(26) = "Windows 3.x/NT Cursor Resource (CUR)"
  87. FilterExt(26) = "CUR"
  88. FilterType(26) = 784
  89. FilterName(27) = "Windows 3.x/NT Bitmap Resource (EXE)"
  90. FilterExt(27) = "EXE"
  91. FilterType(27) = 786
  92. FilterName(28) = "GEM Paint File (IMG)"
  93. FilterExt(28) = "IMG"
  94. FilterType(28) = 787
  95. FilterName(29) = "Kodak Photo CD Image (PCD)"
  96. FilterExt(29) = "PCD"
  97. FilterType(29) = 775
  98. FilterName(30) = "Picture Publisher 4 (PB4)"
  99. FilterExt(30) = "PB4"
  100. FilterType(30) = 789
  101. FilterName(31) = "Adobe Photoshop (PSD)"
  102. FilterExt(31) = "PSD"
  103. FilterType(31) = 788
  104. FilterName(32) = "MACPaint Bitmap (MAC)"
  105. FilterExt(32) = "MAC"
  106. FilterType(32) = 790
  107. FilterName(33) = "Wavelet Compressed Bitmap (WVL)"
  108. FilterExt(33) = "WVL"
  109. FilterType(33) = 777
  110. FilterName(34) = "CALS Compressed Bitmap (CAL)"
  111. FilterExt(34) = "CAL"
  112. FilterType(34) = 800
  113. FilterName(35) = "CorelCHART (CCH)"
  114. FilterExt(35) = "CCH"
  115. FilterType(35) = 1541
  116. FilterName(36) = "CorelMOVE (CMV)"
  117. FilterExt(36) = "CMV"
  118. FilterType(36) = 1539
  119. FilterName(37) = "CorelSHOW (SHW)"
  120. FilterExt(37) = "SHW"
  121. FilterType(37) = 1540
  122. FilterName(38) = "MicroSoft PowerPoint (PPT)"
  123. FilterExt(38) = "PPT"
  124. FilterType(38) = 1548
  125. FilterName(39) = "Video for Windows (AVI)"
  126. FilterExt(39) = "AVI"
  127. FilterType(39) = 1536
  128. FilterName(40) = "AutoDesk FLIC (FLI)"
  129. FilterExt(40) = "FLI"
  130. FilterType(40) = 1543
  131. FilterName(41) = "MPEG Animation (MPG)"
  132. FilterExt(41) = "MPG"
  133. FilterType(41) = 1551
  134. FilterName(42) = "OS/2 Bitmap (BMP)"
  135. FilterExt(42) = "BMP"
  136. FilterType(42) = 792
  137. FilterName(43) = "Corel TRACE (AI)"
  138. FilterExt(43) = "AI"
  139. FilterType(43) = 1301
  140. FilterName(44) = "All Files (*.*)"
  141. FilterExt(44) = "*"
  142. FilterType(44) = -1
  143.  
  144. BEGIN DIALOG AutoPrint 223, 62, "AutoPrint!"
  145.     TEXT  8, 8, 73, 8, "Path to images to print:"
  146.     TEXTBOX  87, 4, 128, 13, PrintPath$
  147.     TEXT  8, 22, 74, 8, "Type of images to print:"
  148.     DDLISTBOX  88, 20, 128, 111, FilterName$, FilterTypeIndex%
  149.     PUSHBUTTON  115, 43, 46, 14, "&Print"
  150.     CANCELBUTTON  170, 43, 46, 14
  151. END DIALOG
  152.  
  153. PrintPath$ = CURRFOLDER
  154. FilterTypeIndex = 44
  155.  
  156. ' show the dialog
  157. retval% = DIALOG(AutoPrint)
  158.  
  159. ' check for cancel
  160. IF retval = 2 THEN STOP
  161.  
  162. ' check for trailing backslash
  163. IF RIGHT(PrintPath$, 1) = "\" THEN PrintPath$ = LEFT(PrintPath$, LEN(PrintPath$) - 1)
  164.  
  165. ' retrieve the extensions
  166. PrintExt$ = FilterExt(FilterTypeIndex)
  167.  
  168. PrintSearch$ = "*." + PrintExt 
  169.  
  170. SearchCriteria$ = PrintPath$ + "\" + "*." + PrintExt$
  171. PrintFile$ = FINDFIRSTFOLDER(SearchCriteria, 1 OR 2 OR 4 OR 8 OR 16 OR 32)
  172. DO WHILE PrintFile$ <> ""
  173.     PrintImage PrintPath$ + "\" + PrintFile$
  174.     PrintFile$ = FINDNEXTFOLDER()
  175. LOOP
  176.  
  177. '--------------------------------------------------------------------------
  178. SUB PrintImage(Filename$)
  179.  
  180.     WITHOBJECT DRAW
  181.         .FileNew
  182.         .FileImport FileName$
  183.         .FilePrint
  184.         .FileClose
  185.     END WITHOBJECT
  186.  
  187. END SUB
  188.