Page 1 of 2
More Hebrew Problems
Posted: Thu Jul 02, 2020 10:54 am
by egolombek
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.
Re: More Hebrew Problems
Posted: Thu Jul 02, 2020 11:09 am
by richmond62
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.
Re: More Hebrew Problems
Posted: Thu Jul 02, 2020 11:27 am
by egolombek
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?
Re: More Hebrew Problems
Posted: Thu Jul 02, 2020 1:58 pm
by dunbarx
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
Re: More Hebrew Problems
Posted: Thu Jul 02, 2020 2:00 pm
by egolombek
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.
Re: More Hebrew Problems
Posted: Thu Jul 02, 2020 3:08 pm
by richmond62
As far as I know, one can only export to PDF from Macintosh . . .
-
-
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
Re: More Hebrew Problems
Posted: Thu Jul 02, 2020 3:10 pm
by richmond62
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?
Re: More Hebrew Problems
Posted: Thu Jul 02, 2020 3:18 pm
by Klaus
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.
Re: More Hebrew Problems
Posted: Thu Jul 02, 2020 3:24 pm
by richmond62
No, with LC 9.6 it works for mac, windows, linux, ios and android
Very good to know.
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.
Re: More Hebrew Problems
Posted: Thu Jul 02, 2020 5:03 pm
by richmond62
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.
-
-

- Stack and exported PNG image of the card.
Re: More Hebrew Problems
Posted: Thu Jul 02, 2020 5:35 pm
by dunbarx
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
Re: More Hebrew Problems
Posted: Fri Jul 03, 2020 6:16 am
by egolombek
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?
Re: More Hebrew Problems
Posted: Fri Jul 03, 2020 12:22 pm
by bogs
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 -

- 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...

- Exported!
- File1.png (225.61 KiB) Viewed 6686 times
...which looks pretty clean to me ?
Re: More Hebrew Problems
Posted: Fri Jul 03, 2020 2:48 pm
by dunbarx
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
Re: More Hebrew Problems
Posted: Fri Jul 03, 2020 4:54 pm
by jacque
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.