Printing to pdf issue

Deploying to Linux? Get penguinated here.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
Scoperzor
Posts: 78
Joined: Tue Jan 27, 2015 1:10 pm

Printing to pdf issue

Post by Scoperzor » Wed Aug 15, 2018 2:39 pm

Hi everyone

I'm running a Linux standalone built in LC 7.0.6 which has worked successfully across 50+ different systems to date. However, only now is one system in particular giving me issues despite the OS being loaded from the same CentOS 7 image I normally use.

The code snippet:

Code: Select all

open printing to pdf tPDFName
put base64decode(syncData) into image "png_image" of card "pdf" //syncData is a text blob
print card "pdf" of this stack into 0,0,595,842
put the result into tResult
close printing
This has run fine until now - tResult has always been empty. But the problematic system is returning "printing failed" in tResult. This isn't very descriptive so it's difficult to know why it's failing. It is using the same standalone as all the other systems, with the PDF Printer inclusion.

Any way to get more debugging from this?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6101
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Printing to pdf issue

Post by FourthWorld » Wed Aug 15, 2018 4:15 pm

LC 7 is many years old. Have you tried the most recent build to see if the issue may have been addressed?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

bogs
Posts: 2063
Joined: Sat Feb 25, 2017 10:45 pm

Re: Printing to pdf issue

Post by bogs » Wed Aug 15, 2018 5:17 pm

Lc7 is old as Richard puts it, but suggesting upgrading doesn't really answer his question.

Unfortunately, I'm not sure I have a suggestion either. That something apparently is different on this one system seems obvious, however you said it was working on that distro previously.

What were the circumstances that initially brought the problem up?
  • Upgrade of the os? ( A change in libraries might cause this, and if this is what prompted the problem, then Richard's answer may be your only option.)
  • Failure of the hardware, causing re-install? (Similar reason above, even if you re-installed from the original image, if any update occurs during the installation your likely on the same plane afterwards).
  • Something else? Feel free to be specific.
My guess is that something (probably a library) updated. If that is the case, testing out on a newer IDE may
prove beneficial, or you may find a completely new set of 'issues'.

As to more inclusive debug information, Richard knows far more than I in that department. Myself, I step it through the internal debugger and watch the system state messages when I find something like this.
Image

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6101
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Printing to pdf issue

Post by FourthWorld » Wed Aug 15, 2018 6:15 pm

bogs wrote:
Wed Aug 15, 2018 5:17 pm
Lc7 is old as Richard puts it, but suggesting upgrading doesn't really answer his question.
The question was about diagnosing and hopefully fixing an issue. I don't have a fix, and didn't offer one. What I suggested was for diagnostics.

If the problem no longer exists in the current version, even better.

If the problem is still evident, using the current version makes it possible to resolve it, as that's the version the team is working. Everything before v9 is frozen in time. With any bug report submitted, if a recipe does not use the current version trying that will be the first question the team will ask. Suggesting that here merely saves time for both the submitter and the team.

It may be that this is not an issue in LC per se at all. But even then, the diagnostic value of at least trying the latest version will help narrow down the root cause.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

bogs
Posts: 2063
Joined: Sat Feb 25, 2017 10:45 pm

Re: Printing to pdf issue

Post by bogs » Wed Aug 15, 2018 7:08 pm

My misunderstanding then, and my apology Richard. Everything else I said though is still the way I would proceed.
Image

Scoperzor
Posts: 78
Joined: Tue Jan 27, 2015 1:10 pm

Re: Printing to pdf issue

Post by Scoperzor » Thu Aug 16, 2018 6:23 am

FourthWorld wrote:
Wed Aug 15, 2018 4:15 pm
LC 7 is many years old. Have you tried the most recent build to see if the issue may have been addressed?
I had completely separate issues previously when trying to compile it in LC 8.1.8, like the fonts coming out all the wrong sizes. Given that all the features had worked previously for so long on 7.0.6, we stuck with it.

I guess I may need to try something more up to date for this install specifically, I had just hoped perhaps there would be a way to get more feedback from this function before doing so.
bogs wrote:
Wed Aug 15, 2018 5:17 pm
My guess is that something (probably a library) updated. If that is the case, testing out on a newer IDE may
prove beneficial, or you may find a completely new set of 'issues'.

Myself, I step it through the internal debugger and watch the system state messages when I find something like this.
By internal debugger are you referring to LC's debugger? If not, could you please clarify? Stepping through that didn't yield anything because it just gave the one resulting line of 'printing failed'.

I also suspected something like a library update, but running through the list of installed packages everything seemed pretty stock standard.

bogs
Posts: 2063
Joined: Sat Feb 25, 2017 10:45 pm

Re: Printing to pdf issue

Post by bogs » Thu Aug 16, 2018 2:09 pm

Scoperzor wrote:
Thu Aug 16, 2018 6:23 am
I had completely separate issues previously when trying to compile it in LC 8.1.8, like the fonts coming out all the wrong sizes. Given that all the features had worked previously for so long on 7.0.6, we stuck with it.
Yah, your experiences look pretty parralel to mine. 8.x from all I understand was a departure from the way Lc was rolling, and the beginning few had a series of changes that have gradually smoothed out (a little).
Scoperzor wrote:
Thu Aug 16, 2018 6:23 am
By internal debugger are you referring to LC's debugger?
Yes, I was referring to the Lc IDEs internal debugger. I seem to remember discussing how to get more exact results with someone at one time, but who and exactly what the method was I've unfortunately forgotten (probably was Jacque, Richard may have contributed as well. I hate getting older :P )

Something you might try (no guarantees) is to launch the program from a terminal on Cent. When started this way, you can sometimes gain insights as to what is fouling up from the Os point of view. Other than that, unless someone else remembers the discussion I mentioned above, I'm fresh out of ideas.
Image

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4559
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Printing to pdf issue

Post by jacque » Thu Aug 16, 2018 5:09 pm

Back in the olden days, the first thing recommended for printing problems was to update the printer driver. Since this is only happening on one system, that's what I'd try first. If there isn't a newer driver, trying a different printer, if possible, may help narrow down the issue.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6101
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Printing to pdf issue

Post by FourthWorld » Thu Aug 16, 2018 6:32 pm

Scoperzor wrote:
Thu Aug 16, 2018 6:23 am
I had completely separate issues previously when trying to compile it in LC 8.1.8, like the fonts coming out all the wrong sizes. Given that all the features had worked previously for so long on 7.0.6, we stuck with it.
If the issues you had fit this recipe, please feel free to add any relevant details not already in the report:
https://quality.livecode.com/show_bug.cgi?id=20581

If your recipe is different, please consider opening a new report there.

I can understand sticking with an older version temporarily, but anything prior to 9 is frozen in time, and as such risks being one OS change away from non-functioning.

Deploy with whatever version you need to of course, but using the most recent version at least in development allows you to identify any issues early on, so it can become possible to address them.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

bogs
Posts: 2063
Joined: Sat Feb 25, 2017 10:45 pm

Re: Printing to pdf issue

Post by bogs » Thu Aug 16, 2018 9:32 pm

FourthWorld wrote:
Thu Aug 16, 2018 6:32 pm
I can understand sticking with an older version temporarily,
I'm a bad example of that statement :P
but anything prior to 9 is frozen in time, and as such risks being one OS change away from non-functioning.
Alternatively, sometimes the bugs you know are easier to deal with than the ones you can only guess at :wink:

You know I'm just kidding right :lol:
Image

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 996
Joined: Thu Apr 11, 2013 11:27 am

Re: Printing to pdf issue

Post by LCMark » Fri Aug 17, 2018 7:50 am

@Scoperzor: There's not many reasons that open printing to pdf <filename> can fail.

It throws an error if it can't find the pdfprinter library (or it doesn't load) - which isn't the case here.

Otherwise 'printing failed' would indicate a failure to open the <filename> for create/write; memory exhaustion (which is exceptionally unlikely), Pango font creation failing, or cairo (the drawing library) it uses failing to do something.

So first thing to check - can you create a file with tPDFName on the system which has a problem?

Next - can you print an empty card successfully (assuming the target file is creatable!)?

Perhaps create a very simple test stack to check the above - and run it on the problem system.

(Note: The above advice was based at looking at the latest 9 source - there has been a few changes to pdfprinting since 7.0.6 - most notably it now uses a much more recent version of cairo, and there have been a few fixes to the way it hooks into the engine).

Scoperzor
Posts: 78
Joined: Tue Jan 27, 2015 1:10 pm

Re: Printing to pdf issue

Post by Scoperzor » Tue Aug 21, 2018 10:07 am

Thanks for all the feedback, I will revert should I find a solution on any of the versions I try.

bogs
Posts: 2063
Joined: Sat Feb 25, 2017 10:45 pm

Re: Printing to pdf issue

Post by bogs » Tue Aug 21, 2018 2:11 pm

LCMark wrote:
Fri Aug 17, 2018 7:50 am
(Note: The above advice was based at looking at the latest 9 source - there has been a few changes to pdfprinting since 7.0.6 - most notably it now uses a much more recent version of cairo, and there have been a few fixes to the way it hooks into the engine).
Good info to file away for the future on things to check, but thank you for the 'Note' part!
Image

Post Reply

Return to “Linux”