Printing 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

Post Reply
Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Printing problems

Post by Da_Elf » Thu Sep 20, 2018 6:02 pm

Im printing the content on a card which is a barcode made up of 95 two pixel wide rectangles. When i print them they show up as skinny lines and not 2 pixels wide. When i export a png it all looks fine. So i figure i should calculate the barcode with my generator. then copy the png data to clipboard, paste it over everything then print that. but im having trouble figuring out the copy to clipboard then insert as image over everything part

from the dictionary i can find this

export image 1 to myVariable as png with standard palette
how do i get it back into an image again

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

Re: Printing problems

Post by Klaus » Thu Sep 20, 2018 6:14 pm

Hi Da_Elf,

you can export directly to another image:

Code: Select all

export image 1 to image "the one to be printed" as png with standard palette
Or if you want to use your variable:

Code: Select all

export image 1 to myVariable as png with standard palette
...
set the text of img "another image for printing" to myVariable
## or
## put myVariable into img "another image for printing"
Hope that helps!


Best

Klaus

Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: Printing problems

Post by Da_Elf » Thu Sep 20, 2018 9:41 pm

That was sooo much help. this is weird. this is the code im using with your new suggestion.

Code: Select all

put the short name of this stack into stackit
   --export snapshot from this card to file "File1.png" as PNG
   
   export snapshot from this card to image "standby" as png with standard palette
   set the layer of img "standby" to top
   set visible of img "standby" to true
   set the formatForPrinting of stack stackit to false
   set the printerName to deprinterR
   set the printPaperOrientation to "portrait"
   set the printMargins to 0,0,0,0
   set the printPaperSize to 612,792
   put (612/(the width of stack stackit)) into prntScl
   set the printScale to prntScl
   print stack stackit
   set the formatForPrinting of stack stackit to true
   set visible of img "standby" to false
here are my results. without the export fix i printed to printer and pdf and got the same skinny lines. When i used the commented out export it looked good. So now im exporting to an image which i overlay everything and then print to pdf and it all looks good now.
Attachments
pdf error.PNG
File1.png
File1.png (3.74 KiB) Viewed 3764 times

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

Re: Printing problems

Post by Klaus » Thu Sep 20, 2018 9:57 pm

Hi Da_Elf,

glad I could help!

Quick and very wild guess:
Were the many rectangle graphics, that did not want to print out correctly, anti-aliased?
If yes, try without and vice versa. :D

Best

Klaus

Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: Printing problems

Post by Da_Elf » Thu Sep 20, 2018 10:39 pm

great minds think alike. yes they were and i turned it off to the same result. When the codes were done larger they printed fine. its when i redesigned them smaller to fit on a 3x10 sticker sheet that i got the problems.
I started to think what if its when my card is resized during printing since the card is 1020 x 1320 and is shrunk down to 612 x 792 so i upped the print size but no good since that is what livecode says a piece of letter paper is in pixel size at 72DPI (screen res). There doesnt seem to be enough options on resolution during printing

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

Re: Printing problems

Post by jacque » Fri Sep 21, 2018 4:48 pm

I think you've got it right, the scaling will reduce everything on the page. If you know you will be reducing the size for printing then the fix is to double the height and width of the lines so that they are proportional when reduced. If you do that then you probably won't need the image.

Another way to fix it would be to reduce the stack size so that the lines are proportional to that and then use the "into rect" printing option to scale the page up on the printer.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”