More Hebrew Problems

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

egolombek
Posts: 74
Joined: Thu Jan 30, 2020 2:11 pm

More Hebrew Problems

Post by egolombek » Thu Jul 02, 2020 10:54 am

So... I am having more Hebrew problems.

I am trying to print a card to pdf, but the print fails if there is Hebrew in a field on the page. It prints in English until it gets to the Hebrew and then it terminates the print job. But, if I there is no Hebrew on the page, it prints without a hitch.

Any ideas at all? Is there some other way to print? It seems to me like this is a bug in Livecode's print to pdf.

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

Re: More Hebrew Problems

Post by richmond62 » Thu Jul 02, 2020 11:09 am

Well, I would suppose you have tried printing an image of the field?

This is odd as I have successfully exported Sanskrit text, using non-standard glyphs
in the Unicode Personal Private Use Area.
Last edited by richmond62 on Thu Jul 02, 2020 11:27 am, edited 1 time in total.

egolombek
Posts: 74
Joined: Thu Jan 30, 2020 2:11 pm

Re: More Hebrew Problems

Post by egolombek » Thu Jul 02, 2020 11:27 am

No, I probably haven't. This is what I am doing:
open printing to pdf prntPath
if the result is "Cancel" then
answer warning "Printing Canceled"
else
repeat with i=1 to 34 -- number of students
put "print"&i into printi
if cd fld "studentName" of cd printi of stack "printMenus" is not empty then
print card printi of stack "printMenus" into 0,50,575,750
print break
end if
end repeat
end if
close printing
launch document prntPath
What does it mean to print an image of a card?

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

Re: More Hebrew Problems

Post by dunbarx » Thu Jul 02, 2020 1:58 pm

Hi.

You are saying that the actual contents of the card terminates the printing process??? I cannot imagine how this could be.

Others will have to chime in. I am only here to ask what you meant by "print break". Oh, and you must be an old Hypercard user, because the phrase "cd fld" is no longer required: there is only one kind of field object in LC.

Craig

egolombek
Posts: 74
Joined: Thu Jan 30, 2020 2:11 pm

Re: More Hebrew Problems

Post by egolombek » Thu Jul 02, 2020 2:00 pm

Yes, cd fld is definitely a habit / relic from my Supercard days (remember that?) :-) But still works. Basically I have not programmed since then so that gives you a sense of how long it has been since I have touched programming.

print break is apparently the command to print a page break.

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

Re: More Hebrew Problems

Post by richmond62 » Thu Jul 02, 2020 3:08 pm

As far as I know, one can only export to PDF from Macintosh . . .
-
Screenshot 2020-07-02 at 17.06.38.png
-

Code: Select all

on mouseUp
         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 "ff"
end mouseUp
Attachments
Chiam.livecode.zip
Here's the stack.
(1.01 KiB) Downloaded 164 times

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

Re: More Hebrew Problems

Post by richmond62 » Thu Jul 02, 2020 3:10 pm

I am trying to print a card to pdf
Whoops: I overlooked that you were trying to print the whole card to PDF.

Is that strictly necessary?

Why not 'just' export a screenshot of the card?

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: More Hebrew Problems

Post by Klaus » Thu Jul 02, 2020 3:18 pm

richmond62 wrote:
Thu Jul 02, 2020 3:08 pm
As far as I know, one can only export to PDF from Macintosh . . .
No, with LC 9.6 it works for mac, windows, linux, ios and android
richmond62 wrote:
Thu Jul 02, 2020 3:10 pm
I am trying to print a card to pdf
Whoops: I overlooked that you were trying to print the whole card to PDF.
Is that strictly necessary?
Why not 'just' export a screenshot of the card?
Because in a PDF file text in fields remains text and can be copied.

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

Re: More Hebrew Problems

Post by richmond62 » Thu Jul 02, 2020 3:24 pm

No, with LC 9.6 it works for mac, windows, linux, ios and android
Very good to know. 8)

And will my code work cross-platform for that?
Because in a PDF file text in fields remains text and can be copied.
Indeed it does . . .

Although go back about 15 years and you'd be hard put to copy from a PDF as
at that point there was no embedded text layer.
Last edited by richmond62 on Thu Jul 02, 2020 4:14 pm, edited 3 times in total.

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

Re: More Hebrew Problems

Post by richmond62 » Thu Jul 02, 2020 5:03 pm

I don't know HOW one can expect to export a "PDF" of a card from a stack as this
would involve decomposing the card into pictorial components with text-embedded bits as well.
-
example.pdf.zip
Example PDF document
(21.67 KiB) Downloaded 152 times
-
Screenshot 2020-07-02 at 18.56.31.png
Stack and exported PNG image of the card.
Attachments
Leah.livecode.zip
Here's the stack.
(1.31 KiB) Downloaded 144 times

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

Re: More Hebrew Problems

Post by dunbarx » Thu Jul 02, 2020 5:35 pm

print break is apparently the command to print a page break.
Aha. That actual string is not in the dictionary, even the glossary, only as a part of the discussion of the "print" command. Good to know.
Yes, cd fld is definitely a habit / relic from my Supercard days (remember that?) :-) But still works
Yes, LC has retained legacy HC and SC syntax as long as there is no conflict with the current state of the language. The important thing to know, which I am sure you do, is that there is no background object type, so there is no distinction between "cd fld" and either of "fld" or "bg fld".

Craig

egolombek
Posts: 74
Joined: Thu Jan 30, 2020 2:11 pm

Re: More Hebrew Problems

Post by egolombek » Fri Jul 03, 2020 6:16 am

Thank you all for the idea of snapShot -- a new command to me.

I have been playing with it, and the quality of the snapshot is low. Writing and graphics are all pixelated. Is there a setting to increase the quality? there seems to be something called metaData but I cannot find any examples of how to use this or if it is even relevant. Thoughts?

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

Re: More Hebrew Problems

Post by bogs » Fri Jul 03, 2020 12:22 pm

Well, the first thing I wondered is if you had come across this article in Max's excellent wiki?

For instance....
egolombek wrote:
Fri Jul 03, 2020 6:16 am
...there seems to be something called metaData but I cannot find any examples of how to use this or if it is even relevant.
The Wiki wrote: metadata - The metadata is an array of metadata. Currently the only key supported is "density" with a value in pixels per inch (ppi).
The dictionary says much the same, but doesn't include Richard's excellent tip on the bottom of the page linked too.

Frankly, I don't see that you would need to use the metadata unless you were including information in the picture file that isn't the picture itself. I'm also curious as to why you would see any pixelation at all. For instance, I set up a card with this picture in it -
aPic_exportSnapshot1.png
Start your engines....
And then exported it with this command from the message box ...

Code: Select all

export snapshot from this card to file "/home/bogs/Desktop/File1.png" as PNG
...and it produced this snapshot...
File1.png
Exported!
File1.png (225.61 KiB) Viewed 4929 times
...which looks pretty clean to me ?
Image

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

Re: More Hebrew Problems

Post by dunbarx » Fri Jul 03, 2020 2:48 pm

All.

Have we glossed over the fact that printing itself stopped simply because Hebrew characters were present in the text? How do it know? I would expect, and I am a newbie with all this unicode stuff, that at worst, some default "box" character would appear in place of chars that the printer could not understand.

But NOT that the print job itself would terminate.

Hmmm?

Craig

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

Re: More Hebrew Problems

Post by jacque » Fri Jul 03, 2020 4:54 pm

I was wondering about the font too. There are many free fonts available on the web, maybe one of those would work better. Or maybe a different printer would work. One thing MC used to stress was that you need the latest print driver, so that would be another thing to check.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”