Page 1 of 1

Relative path and printing do not work for me in 3.5.0-rc-1

Posted: Mon Apr 06, 2009 8:24 am
by user#606
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?

Posted: Mon Apr 06, 2009 2:35 pm
by FourthWorld
What does your script look like?

Posted: Mon Apr 06, 2009 9:32 pm
by BvG
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

Posted: Thu Apr 09, 2009 11:43 am
by user#606
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?