I am using the Open printing to pdf tPDFPath function, yet not without some issues
My goal: Save a piece of a card as a pdf-file without printing a physical sheet, so nothing gets sent to my printer.
A piece of my code:
Code: Select all
on mouseUp
   Ask file "Where do you want to store the file?"
   if "." is not in it then
      put it & ".pdf" into tPDFPath
   else put it into tPdfPath
   
   if the result is "Cancel" then
      go to previous card
      exit mouseUp
   end if
   
   set the visible of field "Number" of card "PrintCard" to true
   set the printmargins to 0,0,0,0
   set the printpaperorientation to portrait 
   open printing to pdf tPdfPath
   
   put the number of lines in field "PrintField" into tLines
   put field "PrintField" into tTotal
   put tLines / 32 into tTotalPrintNumbers2
   add 0.5 to tTotalPrintNumbers2
   put round(tTotalPrintNumbers2) into tTotalPrintNumbers
   put empty into tCounter
   if tLines > 32 then
      repeat until tTotaal < 32
         add 1 to tCounter
         put line 1 to 32 of tTotaal & CR & "Blz " & tCounter & " v/d " & tTotalPrintNumbers into field "PrintField"
         print card "PrintCard" from 317,-90 to 912,752
         delete line 1 to 32 of tTotaal
      end repeat
   else
      print card "PrintCard" from 317,-90 to 912,752
   end if
   close printing
   launch document tPdfPath
   go to previous card
end mouseUp
just 1 thing: My printer also prints a copy of the pdf I have just created, that is the fault.
As I am using the "Print to pdf tPDFpath", should it not send anything to my printer?
Also funny: It only prints something when I try it on my windows standalone, on my Macbook nothing gets printed
Any help is useful!
Thanks in advance

