Announcement

Collapse
No announcement yet.

Trouble with PB printing PDF files.

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

  • Tim Collins
    replied
    Stuart,
    Thank you very much. I tried your code and it works fine.
    I'm needing to send information to a lawyer to set up a Trust. This will help greatly!
    Tim

    Leave a comment:


  • Stuart McLachlan
    replied
    Just looked at your code.
    1. You need XPRINT PREVIEW CLOSE to redirect back to the actual printer.
    2. You need to repeat the print instructions after the preview is closed

    (Look at the example in Help under Contents - Printing - Print Preview - it uses a SUB to avoid having to repeat all the XPRINT lines)
    '
    Code:
    #COMPILE EXE
    #DIM ALL
    
    FUNCTION PBMAIN () AS LONG
    DIM HWIN AS LONG
    DIM PNT AS STRING
    DIM FHNDL(1) AS LONG
    
    GRAPHIC WINDOW NEW "TITLE", 500, 30, 743, 967 TO hwin&
    XPRINT ATTACH CHOOSE
    XPRINT PREVIEW HWIN&, 0
    
    FONT NEW "courier new", 12,1,0,1,0 TO FHNDL(1)
    XPRINT SET FONT FHNDL(1)
    
    XPRINT TAB(10) "Four score and seven years ago our fathers brought forth,"
    XPRINT TAB(10) "upon this continent, a new nation, conceived in liberty,
    XPRINT TAB(10) "and dedicated to the proposition that all men are created equal."
    XPRINT PREVIEW CLOSE
    
    XPRINT TAB(10) "Four score and seven years ago our fathers brought forth,"
    XPRINT TAB(10) "upon this continent, a new nation, conceived in liberty,
    XPRINT TAB(10) "and dedicated to the proposition that all men are created equal."
    XPRINT CLOSE
    
    PRINT "DONE"
    WAITKEY$
    END FUNCTION
    '

    Leave a comment:


  • Tim Collins
    replied
    When the printer window comes up from the "XPRINT ATTACH CHOOSE" line, I select "Microsoft Print to PDF" as my printer of choice.

    I'm not wanting to print a file - just the three lines of Lincoln's Gettysburg address.

    Leave a comment:


  • Dale Yarker
    replied
    What file? Feeding .exe or .bas to Adobe?

    Leave a comment:


  • Stuart McLachlan
    replied
    What printer driver are you selecting with the XPRINT ATTACH CHOOSE ?

    Leave a comment:


  • Tim Collins
    started a topic Trouble with PB printing PDF files.

    Trouble with PB printing PDF files.

    I am not understanding why PBCC doesn't generate a .PDF file that can be read by Adobe Reader. My little test program seems to work, but when I try to open the PDF file with Adobe Reader I get an error message that the file is damaged or not in PDF format. Here's what I am using. What am I doing wrong?
    Tim

    Code:
    #COMPILE EXE
    #DIM ALL
    
    FUNCTION PBMAIN () AS LONG
    DIM HWIN AS LONG
    DIM PNT AS STRING
    DIM FHNDL(1) AS LONG
    
    GRAPHIC WINDOW NEW "TITLE", 500, 30, 743, 967 TO hwin&
    XPRINT ATTACH CHOOSE
    XPRINT PREVIEW HWIN&, 0
    GRAPHIC SET FOCUS
    FONT NEW "courier new", 12,1,0,1,0 TO FHNDL(1)
    XPRINT SET FONT FHNDL(1)
    XPRINT TAB(10) "Four score and seven years ago our fathers brought forth,"
    XPRINT TAB(10) "upon this continent, a new nation, conceived in liberty,
    XPRINT TAB(10) "and dedicated to the proposition that all men are created equal."
    XPRINT CLOSE
    CON.FOCUS
    PRINT "DONE"
    WAITKEY$
    END FUNCTION
Working...
X