|
|||||||
| TX Text Control .NET Server Please use this forum for TX Text Control .NET Server support only. If you need support for a different product, please use the appropriate forum. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
DocumentServer.Web.DocumentViewer.ZoomTo Property FixedSize is missing??
According to documentation there should be a property enumerated value 'fixedsize' for the property DocumentServer.Web.DocumentViewer.ZoomTo.
However, i'm missing that value. Does anyone know what happend with that? I'm in the need of using that value, because I would like to zoom in steps of 10%. Regards Thomas |
|
#2
|
||||
|
||||
|
Re: DocumentServer.Web.DocumentViewer.ZoomTo Property FixedSize is missing??
Hi Thomas,
You have discovered a small bug in our documentation. The value 'FullSize' does exactly what 'FixedSize' was supposed to do. Thank you for pointing this out. We'll fix that with the next version.
__________________
Regards, Lucas Mbiwe, TX Text Control |
|
#3
|
|||
|
|||
|
Re: DocumentServer.Web.DocumentViewer.ZoomTo Property FixedSize is missing??
Hello Lucas,
the FullSize propertie doesn't solve my problem. When using de Zoomfactor between 10 and 100, the page is sometimes cropped within the canvas, and sometimes in runs outside the canvas. This is not what I would like to reach. Is this a known issue? Thomas |
|
#4
|
||||
|
||||
|
Re: DocumentServer.Web.DocumentViewer.ZoomTo Property FixedSize is missing??
Hi Thomas,
Could you please explain what you are trying to do, what the expected behavior is, and what the actual behavior turns out to be? I am afraid, at the moment I cannot really help you, because I do not understand what seems to be the problem.
__________________
Regards, Lucas Mbiwe, TX Text Control |
|
#5
|
|||
|
|||
|
Re: DocumentServer.Web.DocumentViewer.ZoomTo Property FixedSize is missing??
Hello Lucas,
I couldn't find your email adress so here's my Code Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TXTextControl.DocumentServer.Web;
namespace Raet.OfficeLink.Web.UserControls
{
public partial class UIServerTextControl : System.Web.UI.UserControl
{
private TXTextControl.DocumentServer.DocumentController documentController1;
private TXTextControl.ServerTextControl serverTextControl1;
private System.ComponentModel.IContainer components;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
InitializeComponent();
DocumentViewer1.DocumentController = documentController1;
DocumentViewer1.LoadDocument(Server.MapPath("~/Documents/test.doc"));
DocumentViewer1.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBilinear;
DocumentViewer1.ZoomTo = DocumentViewer.ZoomLevel.FullSize;
InitializeToolbarButtonsOnStartUp();
}
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.documentController1 = new TXTextControl.DocumentServer.DocumentController(this.components);
this.serverTextControl1 = new TXTextControl.ServerTextControl();
//
// documentController1
//
this.documentController1.CharCodeChecked = 254;
this.documentController1.CharCodeUnchecked = 168;
this.documentController1.CheckBoxFont = new System.Drawing.Font("Wingdings", 1F);
this.documentController1.TextComponent = this.serverTextControl1;
//
// serverTextControl1
//
this.serverTextControl1.PageMargins.Bottom = 0;
this.serverTextControl1.PageMargins.Left = 0;
this.serverTextControl1.PageMargins.Right = 0;
this.serverTextControl1.PageMargins.Top = 0;
}
private void InitializeToolbarButtonsOnStartUp()
{
butfirst.Enabled = false;
butfirst.Attributes.Remove("isInactive");
butfirst.Attributes.Add("isInactive", "true");
butfirst.ImageUrl = "../Images/button_first_inactive.jpg";
butprevious.Enabled = false;
butprevious.Attributes.Remove("isInactive");
butprevious.Attributes.Add("isInactive", "true");
butprevious.ImageUrl = "../Images/button_previous_inactive.jpg";
but100.Enabled = false;
but100.Attributes.Remove("isInactive");
but100.Attributes.Add("isInactive", "true");
but100.ImageUrl = "../Images/button_100_inactive.jpg";
butplus.Enabled = false;
butplus.Attributes.Remove("isInactive");
butplus.Attributes.Add("isInactive", "true");
butplus.ImageUrl = "../Images/button_plus_inactive.jpg";
}
private void InitializeToolbarButtons()
{
if (DocumentViewer1.PageNumber == 1)
{
butfirst.Enabled = false;
butfirst.Attributes.Remove("isInactive");
butfirst.Attributes.Add("isInactive", "true");
butfirst.ImageUrl = "../Images/button_first_inactive.jpg";
butprevious.Enabled = false;
butprevious.Attributes.Remove("isInactive");
butprevious.Attributes.Add("isInactive", "true");
butprevious.ImageUrl = "../Images/button_previous_inactive.jpg";
}
else
{
butfirst.Enabled = true;
butfirst.Attributes.Remove("isInactive");
butfirst.Attributes.Add("isInactive", "false");
butfirst.ImageUrl = "../Images/button_first.jpg";
butprevious.Enabled = true;
butprevious.Attributes.Remove("isInactive");
butprevious.Attributes.Add("isInactive", "false");
butprevious.ImageUrl = "../Images/button_previous.jpg";
}
if (DocumentViewer1.TotalPages == 1 || DocumentViewer1.TotalPages == DocumentViewer1.PageNumber)
{
butnext.Enabled = false;
butnext.Attributes.Remove("isInactive");
butnext.Attributes.Add("isInactive", "true");
butnext.ImageUrl = "../Images/button_next_inactive.jpg";
butlast.Enabled = false;
butlast.Attributes.Remove("isInactive");
butlast.Attributes.Add("isInactive", "true");
butlast.ImageUrl = "../Images/button_last_inactive.jpg";
}
else
{
butnext.Enabled = true;
butnext.Attributes.Remove("isInactive");
butnext.Attributes.Add("isInactive", "false");
butnext.ImageUrl = "../Images/button_next.jpg";
butlast.Enabled = true;
butlast.Attributes.Remove("isInactive");
butlast.Attributes.Add("isInactive", "false");
butlast.ImageUrl = "../Images/button_last.jpg";
}
if (DocumentViewer1.ZoomFactor == 100)
{
but100.Enabled = false;
but100.Attributes.Remove("isInactive");
but100.Attributes.Add("isInactive", "true");
but100.ImageUrl = "../Images/button_100_inactive.jpg";
butplus.Enabled = false;
butplus.Attributes.Remove("isInactive");
butplus.Attributes.Add("isInactive", "true");
butplus.ImageUrl = "../Images/button_plus_inactive.jpg";
}
else
{
but100.Enabled = true;
but100.Attributes.Remove("isInactive");
but100.Attributes.Add("isInactive", "false");
but100.ImageUrl = "../Images/button_100.jpg";
butplus.Enabled = true;
butplus.Attributes.Remove("isInactive");
butplus.Attributes.Add("isInactive", "false");
butplus.ImageUrl = "../Images/button_plus.jpg";
}
if (DocumentViewer1.ZoomFactor == 50)
{
but50.Enabled = false;
but50.Attributes.Remove("isInactive");
but50.Attributes.Add("isInactive", "true");
but50.ImageUrl = "../Images/button_50_inactive.jpg";
}
else
{
but50.Enabled = true;
but50.Attributes.Remove("isInactive");
but50.Attributes.Add("isInactive", "false");
but50.ImageUrl = "../Images/button_50.jpg";
}
if (DocumentViewer1.ZoomFactor == 10)
{
butmin.Enabled = false;
butmin.Attributes.Remove("isInactive");
butmin.Attributes.Add("isInactive", "true");
butmin.ImageUrl = "../Images/button_min_inactive.jpg";
}
else
{
butmin.Enabled = true;
butmin.Attributes.Remove("isInactive");
butmin.Attributes.Add("isInactive", "false");
butmin.ImageUrl = "../Images/button_min.jpg";
}
}
protected void butfirst_Click(object sender, ImageClickEventArgs e)
{
DocumentViewer1.PageNumber = 1;
InitializeToolbarButtons();
}
protected void butprevious_Click(object sender, ImageClickEventArgs e)
{
DocumentViewer1.PageNumber = DocumentViewer1.PageNumber - 1;
InitializeToolbarButtons();
}
protected void butnext_Click(object sender, ImageClickEventArgs e)
{
DocumentViewer1.PageNumber = DocumentViewer1.PageNumber + 1;
InitializeToolbarButtons();
}
protected void butlast_Click(object sender, ImageClickEventArgs e)
{
DocumentViewer1.PageNumber = DocumentViewer1.TotalPages;
InitializeToolbarButtons();
}
protected void butmin_Click(object sender, ImageClickEventArgs e)
{
DocumentViewer1.ZoomTo = DocumentViewer.ZoomLevel.FullSize;
DocumentViewer1.ZoomFactor = (DocumentViewer1.ZoomFactor - 10);
InitializeToolbarButtons();
}
protected void butplus_Click(object sender, ImageClickEventArgs e)
{
DocumentViewer1.ZoomTo = DocumentViewer.ZoomLevel.FullSize;
DocumentViewer1.ZoomFactor = (DocumentViewer1.ZoomFactor + 10);
InitializeToolbarButtons();
}
protected void but50_Click(object sender, ImageClickEventArgs e)
{
DocumentViewer1.ZoomTo = DocumentViewer.ZoomLevel.FullSize;
DocumentViewer1.ZoomFactor = 50;
InitializeToolbarButtons();
}
protected void but100_Click(object sender, ImageClickEventArgs e)
{
DocumentViewer1.ZoomTo = DocumentViewer.ZoomLevel.FullSize;
DocumentViewer1.ZoomFactor = 100;
InitializeToolbarButtons();
}
}
}
|
|
#6
|
|||
|
|||
|
Re: DocumentServer.Web.DocumentViewer.ZoomTo Property FixedSize is missing??
Code:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UIServerTextControl.ascx.cs" Inherits="Raet.OfficeLink.Web.UserControls.UIServerTextControl" %>
<%@ Register assembly="TXDocumentServer, Version=15.0.200.500, Culture=neutral, PublicKeyToken=6b83fe9a75cfb638" namespace="TXTextControl.DocumentServer.Web" tagprefix="cc1" %>
<% if (Request.Browser.IsBrowser("IE") && Request.Browser.MajorVersion == 6)
{
%>
<style type="text/css">
#ctl00_content_UITXTCONTROL_DocumentViewer1_view {height: 100% !important; top:0px !important; position: absolute !important; width: 100% !important;}
</style>
<%
}
else
{ %>
<style type="text/css">
#ctl00_content_UITXTCONTROL_DocumentViewer1_view {height: auto !important; top:32px !important; bottom: 0px !important; position: absolute !important; width: 100% !important;}
</style>
<% } %>
<style type="text/css">
.ToolBar
{
position:absolute;
top:0px;
width: 100%;
height: 36px;
background-image: url(../Images/toolbar.jpg);
background-repeat:repeat-x;
background-color:Transparent;
z-index:1;
overflow:hidden;
color:#B3DF00;
}
.ToolBar_Left
{
position: absolute;
top: 0px;
left: 0px;
padding-top:7px;
padding-left:4px;
font-family: Arial, Times New Roman;
font-size: 16px;
font-stretch:wider;
font-weight:bold;
}
.ToolBar_Mid
{
position:relative;
top: 0px;
margin:0px auto;
width: 276px;
height:36px;
}
.ToolBar_Right
{
position: absolute;
top: 0px;
right: 0px;
}
.ToolBar_Mid1
{
position:absolute;
left:0px;
top:0px;
}
.ToolBar_Mid2
{
position:absolute;
top:0px;
left:200px;
}
.ToolBar_PageSize
{
position:absolute;
top:0px;
left:83px;
width: 115px;
height: 36px;
background-image: url(../Images/pagecount_toolbar.jpg);
background-repeat:no-repeat;
}
.ToolBar_PageSize_Container
{
position:relative;
margin:0px auto;
width:100px;
text-align:center;
padding-top:9px;
font-family: Arial, Times New Roman;
font-size: 16px;
font-stretch:wider;
font-weight:bold;
}
</style>
<script language="javascript" type="text/javascript">
function MouseOver(obj, imgurl) {
if (obj.getAttribute('isInactive') == 'false') {
obj.src = imgurl;
}
}
function MouseOut(obj, imgurl) {
if (obj.getAttribute('isInactive') == 'false') {
obj.src = imgurl;
}
}
</script>
<div class="ToolBar">
<div class="ToolBar_Left">
Document Viewer
</div>
<div class="ToolBar_Mid">
<div class="ToolBar_Mid1">
<asp:ImageButton runat="server" ImageUrl="../Images/button_first.jpg" EnableViewState="false"
id="butfirst" isInactive="false"
onmouseover="javascript:MouseOver(this, '../Images/button_first_over.jpg')"
onmouseout="javascript:MouseOut(this, '../Images/button_first.jpg')"
onclick="butfirst_Click" />
<asp:ImageButton runat="server" ImageUrl="../Images/button_previous.jpg" EnableViewState="false"
id="butprevious" isInactive="false"
onmouseover="javascript:MouseOver(this, '../Images/button_previous_over.jpg')"
onmouseout="javascript:MouseOut(this, '../Images/button_previous.jpg')"
onclick="butprevious_Click"/>
</div>
<div class="ToolBar_PageSize">
<div class="ToolBar_PageSize_Container"><%= this.DocumentViewer1.PageNumber %> / <%= this.DocumentViewer1.TotalPages %></div>
</div>
<div class="ToolBar_Mid2">
<asp:ImageButton runat="server" ImageUrl="../Images/button_next.jpg" EnableViewState="false"
id="butnext" isInactive="false"
onmouseover="javascript:MouseOver(this, '../Images/button_next_over.jpg')"
onmouseout="javascript:MouseOut(this, '../Images/button_next.jpg')"
onclick="butnext_Click"/>
<asp:ImageButton runat="server" ImageUrl="../Images/button_last.jpg" EnableViewState="false"
id="butlast" isInactive="false"
onmouseover="javascript:MouseOver(this, '../Images/button_last_over.jpg')"
onmouseout="javascript:MouseOut(this, '../Images/button_last.jpg')"
onclick="butlast_Click"/>
</div>
</div>
<div class="ToolBar_Right">
<asp:ImageButton runat="server" ImageUrl="../Images/button_min.jpg" id="butmin" EnableViewState="false"
isInactive="false"
onmouseover="javascript:MouseOver(this, '../Images/button_min_over.jpg')"
onmouseout="javascript:MouseOut(this, '../Images/button_min.jpg')"
onclick="butmin_Click"/>
<asp:ImageButton runat="server" ImageUrl="../Images/button_plus.jpg" EnableViewState="false"
id="butplus" isInactive="false"
onmouseover="javascript:MouseOver(this, '../Images/button_plus_over.jpg')"
onmouseout="javascript:MouseOut(this, '../Images/button_plus.jpg')"
onclick="butplus_Click"/>
<asp:ImageButton runat="server" ImageUrl="../Images/button_50.jpg" id="but50" EnableViewState="false"
isInactive="false"
onmouseover="javascript:MouseOver(this, '../Images/button_50_over.jpg')"
onmouseout="javascript:MouseOut(this, '../Images/button_50.jpg')"
onclick="but50_Click"/>
<asp:ImageButton runat="server" ImageUrl="../Images/button_100.jpg" id="but100" EnableViewState="false"
isInactive="false"
onmouseover="javascript:MouseOver(this, '../Images/button_100_over.jpg')"
onmouseout="javascript:MouseOut(this, '../Images/button_100.jpg')"
onclick="but100_Click"/>
</div>
</div>
<cc1:DocumentViewer ID="DocumentViewer1" runat="server" Width="100%" Height="100%" ToolBar="false"/>
The problem is the next piece of code: Code:
protected void butmin_Click(object sender, ImageClickEventArgs e)
{
DocumentViewer1.ZoomTo = DocumentViewer.ZoomLevel.FullSize;
DocumentViewer1.ZoomFactor = (DocumentViewer1.ZoomFactor - 10);
InitializeToolbarButtons();
}
protected void butplus_Click(object sender, ImageClickEventArgs e)
{
DocumentViewer1.ZoomTo = DocumentViewer.ZoomLevel.FullSize;
DocumentViewer1.ZoomFactor = (DocumentViewer1.ZoomFactor + 10);
InitializeToolbarButtons();
}
protected void but50_Click(object sender, ImageClickEventArgs e)
{
DocumentViewer1.ZoomTo = DocumentViewer.ZoomLevel.FullSize;
DocumentViewer1.ZoomFactor = 50;
InitializeToolbarButtons();
}
protected void but100_Click(object sender, ImageClickEventArgs e)
{
DocumentViewer1.ZoomTo = DocumentViewer.ZoomLevel.FullSize;
DocumentViewer1.ZoomFactor = 100;
InitializeToolbarButtons();
}
Best Regards, Thomas |
|
#7
|
||||
|
||||
|
Re: DocumentServer.Web.DocumentViewer.ZoomTo Property FixedSize is missing??
Hi Thomas,
After having tested the DocumentServer intensely using several server configurations, I'd like to point out the following: If you have configured your application pool to use more than one worker process—which you should when using the document viewer—please make sure the session state is not kept in process. State server or DB are the ways to go in that case. Regarding your code: Code:
if (!Page.IsPostBack)
{
InitializeComponent();
DocumentViewer1.DocumentController = documentController1;
DocumentViewer1.LoadDocument(Server.MapPath("~/Documents/test.doc"));
DocumentViewer1.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBilinear;
DocumentViewer1.ZoomTo = DocumentViewer.ZoomLevel.FullSize;
InitializeToolbarButtonsOnStartUp();
}
__________________
Regards, Lucas Mbiwe, TX Text Control |
|
#8
|
|||
|
|||
|
Re: DocumentServer.Web.DocumentViewer.ZoomTo Property FixedSize is missing??
Thanks! It solved my problem.
I changed the load block to this: Code:
InitializeComponent();
DocumentViewer1.DocumentController = documentController1;
DocumentViewer1.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBilinear;
DocumentViewer1.ZoomTo = DocumentViewer.ZoomLevel.FullSize;
if (!Page.IsPostBack)
{
DocumentViewer1.LoadDocument(Server.MapPath("~/Documents/test.doc"));
InitializeToolbarButtonsOnStartUp();
}
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using the ObjectItem property with Embedded Excel Worksheets | siveyjos | TX Text Control ActiveX | 4 | February 4, 2010 13:15:42 |
| Selection property is null | ealsmyr | TX Text Control .NET | 13 | September 18, 2007 13:10:58 |
| ControlChar property not working with toolbar | dcaId9 | TX Text Control ActiveX | 0 | January 5, 2004 17:35:48 |
| FieldCursor property in .NET [TX .NET prerelease] | Unregistered | TX Text Control .NET | 2 | December 15, 2003 17:25:45 |