Announcement

Collapse
No announcement yet.

Printing to plotters...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lance Edmonds
    replied
    PRINTER_INFO_5 is not supported by Windows NT. Win2K and Win9x do support that structure.

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Timm Motl
    replied
    Mark:

    No experience with plotters, but my first step would be to run some code like this to see what I could
    learn about the printer in question (width / height)...
    Code:
    #COMPILE EXE
    #REGISTER NONE
    #INCLUDE "WIN32API.INC"
    
    
    FUNCTION PBMAIN
       DIM PInfo5(0:2) AS PRINTER_INFO_5
       EnumPrinters %PRINTER_ENUM_LOCAL, BYVAL %NULL, 5, BYVAL VARPTR(PInfo5(0)), 0, Needed&, Returned&
       Upper& = Needed& \ SIZEOF(pInfo5(0))
       REDIM pInfo5(0:Upper&)
       EnumPrinters %PRINTER_ENUM_LOCAL, BYVAL %NULL, 5, BYVAL VARPTR(pInfo5(0)), (Upper& + 1) * SIZEOF(pInfo5(0)), Needed&, Returned&
    
    
       MSGBOX STR$(Returned&) + " Printers found"
    
    
       FOR LoopVar& = 0 TO (Returned& - 1)
          Printer_hDC& = CreateDC(BYVAL %Null, PInfo5(LoopVar&)[email protected], BYVAL %Null, BYVAL %Null)
          PrnWidth& = GetDeviceCaps(Printer_hDC&, %PHYSICALWIDTH)
          PrnHeight& = GetDeviceCaps(Printer_hDC&, %PHYSICALHEIGHT)
          IF PrnWidth& < PrnHeight& THEN
             Orientation$ = "Portrait"
          ELSE
             Orientation$ = "Landscape"
          END IF
          DeleteDc Printer_hDC&
          Attribute$ = ""
          IF (PInfo5(LoopVar&).Attributes AND %PRINTER_ATTRIBUTE_LOCAL) THEN
             Attribute$ = "Local "
          END IF
          IF (PInfo5(LoopVar&).Attributes AND %PRINTER_ATTRIBUTE_NETWORK) THEN
             Attribute$ = "Network "
          END IF
          IF (PInfo5(LoopVar&).Attributes AND %PRINTER_ATTRIBUTE_DEFAULT) THEN
             Attribute$ = Attribute$ + "Default "
          END IF
          IF (PInfo5(LoopVar&).Attributes AND %PRINTER_ATTRIBUTE_DIRECT) THEN
             Attribute$ = Attribute$ + "Direct "
          ELSE
             Attribute$ = Attribute$ + "Spooled "
          END IF
          IF (PInfo5(LoopVar&).Attributes AND %PRINTER_ATTRIBUTE_QUEUED) THEN
             Attribute$ = Attribute$ + "Queued "
          END IF
          IF (PInfo5(LoopVar&).Attributes AND %PRINTER_ATTRIBUTE_SHARED) THEN
             Attribute$ = Attribute$ + "Shared "
          END IF
          IF (PInfo5(LoopVar&).Attributes AND %PRINTER_ATTRIBUTE_WORK_OFFLINE) THEN
             Attribute$ = Attribute$ + "Work Offline "
          END IF
          IF (PInfo5(LoopVar&).Attributes AND %PRINTER_ATTRIBUTE_HIDDEN) THEN
             Attribute$ = Attribute$ + "Hidden"
          END IF
          MSGBOX "Printer #" + STR$(LoopVar&+1) + $CRLF + $CRLF + PInfo5(LoopVar&)[email protected] + $CRLF + _
                 PInfo5(LoopVar&)[email protected] + $CRLF + Attribute$ + $CRLF + Orientation$ + $CRLF + _
                 "Width:  " + STR$(PrnWidth&) + $CRLF + "Height: " + STR$(PrnHeight&)
       NEXT
    END FUNCTION
    Timm

    Leave a comment:


  • Guest's Avatar
    Guest started a topic Printing to plotters...

    Printing to plotters...

    Hello Everyone!

    I have a small project that has the potential to turn into a big headache. I have been given the task of writing a utility that prints very long bitmaps to a plotter(inkjet). I was hoping that some of you could help me out with some questions.

    1. How does a plotter treat "pages"?
    2. Do you still use StartPage and EndPage in the same manner?
    3. How big would the plotters DC bitmap height be?

    Most pages are about 11 inches in length but how does this work with the plotters paper roll?


    Thanks in advance!




    ------------------
    Cheers
Working...
X