DWF Viewer (Read Only)
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing PaperVisible Property via API

2 REPLIES 2
Reply
Message 1 of 3
felipe2k3
239 Views, 2 Replies

Changing PaperVisible Property via API

Changing the viewer PaperVisible property from true to false using the API, in an already loaded page, does not hide the paper shadow border. It only hides the paper color.

It works correctly when I perform the same action from the context menu. Is this a bug in the API or am I do something wrong?

Code sample:

// Change the Express Viewer source
oCAdViewer.SourcePath="test.dwf";
// Change the viewer properties
with (oCAdViewer.Viewer)
{
// Wait until the page finishs loading
WaitForPageLoaded();
// Hide the toolbars
ToolbarVisible=false;
// Hide the paper background
PaperVisible=false;
// Execute this command
ExecuteCommand("FITTOWINDOW");
}
2 REPLIES 2
Message 2 of 3
felipe2k3
in reply to: felipe2k3

Reposting code sample to make it easier to read:



// Change the Express Viewer path

oCAdViewer.SourcePath="test.dwf";

// Change the viewer properties

with (oCAdViewer.Viewer)

{

&nsbp;&nsbp;// Wait until the page finishs loading

&nsbp;&nsbp;WaitForPageLoaded();

&nsbp;&nsbp;// Hide the toolbars

&nsbp;&nsbp;ToolbarVisible=false;

&nsbp;&nsbp;// Hide the paper background

&nsbp;&nsbp;PaperVisible=false;

&nsbp;&nsbp;// Execute this command

&nsbp;&nsbp;ExecuteCommand("FITTOWINDOW");

}
Message 3 of 3
Anonymous
in reply to: felipe2k3

Unfortunately I'm not seeing the same problem as you are. I'm trying to
reproduce this problem using VBScript and events. Here is what I'm working
with, which seems to work properly.

script language="vbscript">

'-------------------------------------------------------------------'
' This demonstrates catching an event '
'-------------------------------------------------------------------'
function AdView_OnEndLoadItem(name, data, result)
if name = "DOCUMENT" then
AdView.Viewer.ToolbarVisible = false
AdView.Viewer.PaperVisible=false
AdView.Viewer.ExecuteCommand("FITTOWINDOW")
end if
end function
/script>


Please try this code and see if you still have a problem.


"felipe2k3" wrote in message
news:f1a01fa.0@WebX.maYIadrTaRb...
> Reposting code sample to make it easier to read:
>
> // Change the Express Viewer path
> oCAdViewer.SourcePath="test.dwf";
> // Change the viewer properties
> with (oCAdViewer.Viewer)
> {
> &nsbp;&nsbp;// Wait until the page finishs loading
> &nsbp;&nsbp;WaitForPageLoaded();
> &nsbp;&nsbp;// Hide the toolbars
> &nsbp;&nsbp;ToolbarVisible=false;
> &nsbp;&nsbp;// Hide the paper background
> &nsbp;&nsbp;PaperVisible=false;
> &nsbp;&nsbp;// Execute this command
> &nsbp;&nsbp;ExecuteCommand("FITTOWINDOW");
> }
>

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report