PDF printing problem

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9578
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

PDF printing problem

Post by dunbarx » Mon Oct 15, 2018 9:14 pm

I had mentioned something like this once before, but need help again.

I am trying to print a bunch of line graphics to PDF. If I use the "Print..." menuItem in the "File" menu, and then "Save as PDF" in the dropdown there, I get a pretty decent rendering of the graphics on the card.

But if I

Code: Select all

 open printing to pdf (filePath & ".pdf")
   print this card
 close printing
I get a distorted image in the resultant pdf. Some lines change both weight and position.

Is there a way to use whatever pdf gadget LC uses from the menu when printing to pdf, as opposed to the "open printing to pdf" command? Why would they be different?

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: PDF printing problem

Post by richmond62 » Wed Nov 21, 2018 6:48 pm

whatever pdf gadget LC uses from the menu
I'm not sure which operating system you are using, but, back in the stone age over
here on Mac OS 10.7.5 Livecode 8.1.10 can ONLY print to PDF using the inherent
capabilities of the operating system itslef rather than anything inwith LiveCode Ding An Sich.
-
arsingRound.png
-
Digging around in the Dictionary I came across rreHardcopyPrintPDF

which, it turns out, only works for mobile devices, which

underlines my thesis that the LiveCode people have got their eyes so
firmly fixed on tablets and phones they are neglecting desktop computers.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: PDF printing problem

Post by richmond62 » Wed Nov 21, 2018 7:05 pm

My main "bitch" with printing to pdf is that it will NOT print the contents of a field.

HOWEVER, my Devawriter Pro CAN print a field's contents to PDF (admittedly on Mac OS only):

Code: Select all

on mouseUp
   put the systemVersion into ZYS
  if ZYS contains "Windows" then
         set the vis of img "WinWarnZ.png" to true
  else
     if ZYS contains "NT" then
        set the vis of img "WinWarnZ.png" to true
        else
   ask file "Save as:" with "Print.pdf"
   put it into tFileName
   if tFileName is empty then exit to top

   set the printerOutput to "file:" & tFileName

   revShowPrintDialog false, false
   revPrintField the long name of fld "fRESULT"

end if
end if

end mouseUp
where fld "fRESULT" is the field which has to have its contents printed.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9578
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: PDF printing problem

Post by dunbarx » Wed Nov 21, 2018 7:18 pm

Richmond.

So you are saying that the "save as PDF" calls something in Acrobat, but "Open printing to PDF" calls something in the OS?

Rats.
My main "bitch" with printing to pdf is that it will NOT print the contents of a field.
You mean there is no analog to the "revPrintField" command?

Anyone else wish there were much better PDF gadgetry in LC?

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: PDF printing problem

Post by richmond62 » Wed Nov 21, 2018 7:20 pm

As far as I'm aware there is nothing like

"revPrintToPDFfield"

which would be lovely.

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: PDF printing problem

Post by capellan » Wed Nov 21, 2018 8:11 pm

Probably I am doing something wrong, but I could print
text fields to PDF using open printing.

In fact, the PDF is produced by Livecode using a pdf printer
driver from Cairo Graphics Project version 1.14.6

By the way, Cairo Graphics Project produces a svg printer
driver that produces svg files for svg 1.1 or svg 1.2
Last edited by capellan on Sat Nov 24, 2018 12:52 am, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: PDF printing problem

Post by richmond62 » Wed Nov 21, 2018 8:16 pm

I could print
text fields to PDF using open printing
-
Wow!

Please share the Good News.

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: PDF printing problem

Post by capellan » Wed Nov 21, 2018 8:44 pm

Check this PDF saved from a Livecode stack. You could select
and copy the text.

Compare the PDF with a screenshot of the stack.

The PDF printing parameters selected for this specific stack
explain the visible differences.
LiveCode_PDF_Text_Field.png
LiveCode_PDF_Text_Field.zip

Post Reply

Return to “Talking LiveCode”