PDF problems

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
MaxDangerMouse
Posts: 19
Joined: Wed Jan 26, 2011 7:04 am

PDF problems

Post by MaxDangerMouse » Wed Oct 09, 2013 4:16 am

Hi,

I've got an app that creates a pdf report based on the contents of a couple of cards. It used to work well and now I've done something and can't seem to get it to work properly any more.

There are 4 cards. If I try to convert them all to pdf only the 1st works. If I try just the last 3 only the 2nd and 3rd pages come out and the fourth page doesn't show one of the fields.

Here's the code that I'm using.

Code: Select all

   put specialFolderPath("documents") & "/edCoachReport.pdf" into tPDFPath
   open printing to pdf tPDFPath
 
      Print card "CrepIntro" of this stack into 0,0,1000,1500
      print break
      Print card "CrepRes" of this stack into 0,0,1000,1500
      print break 
      Print card "Crep3" of this stack into 0,0,1000,1500
      Print break
      Print card "Crepquest" of this stack into 0,0,1000,1500
      Print break

   close printing
Is there anyone who understands the issues that can come up with printing to pdf that could help?

Thanks
Max

CenturyMan1979
Posts: 86
Joined: Tue May 15, 2012 5:56 pm

Re: PDF problems

Post by CenturyMan1979 » Wed Oct 09, 2013 7:37 am

Have you tried it without the print breaks to see what your results are? I have a script that converts cards into a pdf but I am doing it with "print card [from leftTop to rightBottom]" and I did not use page break between my print commands. This might also have worked for me as I had formatted a group on a the card to be the size of the paper I was going to print on.

MaxDangerMouse
Posts: 19
Joined: Wed Jan 26, 2011 7:04 am

Re: PDF problems

Post by MaxDangerMouse » Sat Oct 19, 2013 8:56 am

Thanks

I tried it without the print breaks and still no luck.

I eventually worked it out though and thought I'd post in case anyone else had this problem.

I was populating the cards with text (within a field) that I'd pasted from MS word. After messing around with them a bit I realised there were some junk characters at the end of the field. When I removed those the PDF printing went back to working. I only discovered them when I opened the stack in windows (I'd been developing on a mac).

Hope that helps someone one day.

Max

Post Reply