Jump to content

Rotate Graphics


JoyceKeller

Recommended Posts

With some help from Dan Korn, I was able to successfully rotate a photo based on whether it is landscape or portrait.

The problem is that, again, it works GREAT on my desktop but the function isn’t functioning in the FP Web application.

I’m attaching my collected, zipped folder. (well, my attachment errors out) I’m hoping someone can help me with the IsResourceLandscape function to make it work for FP Web. The function looks like this:

function IsResourceLandscape(res)

{

if (!res instanceof FusionProResource)

throw "Not a resource: " + res;

if (!res.exists)

throw "Resource not found: " + res;

var TM = new FusionProTextMeasure;

TM.useTags = true;

var err=TM.CalculateTextExtent(res.content);

if (err)

throw "Error measuring resource: " + res + ": " + TM.messages;

Print(res + ": Width=" + TM.textWidth + ", Depth=" + TM.textHeight);

return TM.textWidth > TM.textHeight;

}

I am calling it in like this (LandscapeRule) for a Landscape-oriented photo (keep in mind that the landscape and portrait FP Graphic boxes lay directly on top of each other):

var MyResource = Resource(Field("Photo1"));

if (IsResourceLandscape(MyResource))

return MyResource;

//else

return NullResource();

and like this (PortraitRule) for a Portrait oriented photo:

var MyResource = Resource(Field("Photo1"));

if (!IsResourceLandscape(MyResource))

return MyResource;

//else

return NullResource();

I am already using a function named “matchPathToString” to read the FP Library Image Name incorporated in some other rules. This works like a dream:

function matchPathToString(path, stringToMatch)

{

path = ToUpper(path);

stringToMatch = ToUpper(stringToMatch);

searchResult = path.indexOf(stringToMatch);

if (searchResult > -1)

return true;

else

return false;

}

I feel pretty sure I’m going to need to do something similar for the function IsResourceLandscape to be able to measure the dimensions of the FP Library Images.

Help. Thanks.

Link to comment
Share on other sites

The problem is that, again, it works GREAT on my desktop but the function isn’t functioning in the FP Web application.

What exactly do you mean by, "The function isn’t functioning?" Exactly what are you seeing, and how is that different than your expected results? Are the graphics simply not rotating properly, are they not showing up at all, are they in the wrong place, or what? Can you look at the log (.msg) file for any messages?

Link to comment
Share on other sites

Hi Dan,

 

I'm attaching a zipped folder of my collected files, plus low rez images.

 

After composing on my computer, I am able to view a pdf that has properly oriented photos.

 

After collecting and uploading the Template in the PrintOne Manager, I assign the proper library images and configure the rest of the tabs. When previewing, no photos are visible in the result. Appropriate text for each photo is assigned, but no photos.

 

Rich Lewis helped me with the MatchPathToString function to be able to reference my library images for some text rules. I learned FP Web looks for a different image path which is why I wasn't getting anything at all in my preview results until Rich gave me the MatchPathToString function. I'm wondering if the function you helped me with is unable to find the images because of a different path than what it expects. Or because I am assigning a rule to the graphic hole instead of an image?

 

Thanks for all you do.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...