I wasted a day yesterday trying to solve these issues and I hope someone can help. Yes, I did read the documentation and even used the print example in resorces.
I understand that if the file to be read is in the same folder as the exe or development environment the relative path to the file should work, but it does not do so for me.
C:/Program Files/Revolution Enterprise/3.5.0-rc-1/Introduction.mht
is the full path.
I have tried ..Introduction.mht also ../Introduction.mht or ..\Introduction.mht and no luck. what would you use?
The printing item is simply to print a card in landscape mode to A4.
the card size is 1024 width x 768 height.
I can get a print to pdf perfectly, but is off the page if directed to a printer.
What would you use for consistant results?
Relative path and printing do not work for me in 3.5.0-rc-1
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 10049
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
What does your script look like?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
i see that you prepend dots to your path. This is not necessary. Just check the defaultfolder is correct, and if your file is in there, you can use a relative reference to access it:
Code: Select all
on mouseUp
put url "file:introduction.txt"
end mouseUp
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Sorry for the delay in reply FourthWorld, the script from resource centre is this:-
on printThisCard thePaperSize,theMargin
-- set up defaults if no size and margin provided:
if thePaperSize is empty then put the printPaperSize into thePaperSize
if theMargin is empty then put 72 into theMargin
-- get the page area:
set the printMargins to \
theMargin,theMargin,theMargin,theMargin
put theMargin,theMargin, \
item 1 of thePaperSize - theMargin, \
item 2 of thePaperSize - theMargin \
into destinationRect
-- print into that rectangle:
print this card into destinationRect
end printThisCard
By including Landscape in the code, the result is the card squeezed to a portrait A4 width on the left side of the landscape A4 page. The bottom of the card is cut off as well.
In reply to BvG, the ideal would be to discover the path to the exe when the exe first starts and use this to set the path for the data file.
Can you help?
on printThisCard thePaperSize,theMargin
-- set up defaults if no size and margin provided:
if thePaperSize is empty then put the printPaperSize into thePaperSize
if theMargin is empty then put 72 into theMargin
-- get the page area:
set the printMargins to \
theMargin,theMargin,theMargin,theMargin
put theMargin,theMargin, \
item 1 of thePaperSize - theMargin, \
item 2 of thePaperSize - theMargin \
into destinationRect
-- print into that rectangle:
print this card into destinationRect
end printThisCard
By including Landscape in the code, the result is the card squeezed to a portrait A4 width on the left side of the landscape A4 page. The bottom of the card is cut off as well.
In reply to BvG, the ideal would be to discover the path to the exe when the exe first starts and use this to set the path for the data file.
Can you help?