Search Results

Search found 8 results on 1 pages for 'documentviewer'.

Page 1/1 | 1 

  • Disabling text selection in DocumentViewer

    - by bjutus
    Hello! Simple question. How do you disable the text selection of DocumentViewer in WPF? This is the feature where an XPS document is displayed by the viewer and then text can be highlighted via mouse. The highlighted text can also be copied but I have already disabled this. I just don't know how to disable the highlighting. Thanks!

    Read the article

  • Disable CTRL+P in WPF DocumentViewer

    - by Groupal
    I'm working on a new presenation component for one of our applications. I am building a Custom WPF Control that just has a DocumentViewer in it and hosting that CC in a Windows Forms application with an ElementHost. I'm using Visual Studio 2008 with C#. I have customized everything through the XAML to give it the look and feel that integrates it perfecting into our application, but one thing remains... If you press CTRL+P the print dialog still comes up. I'm at a complete loss as to how to disable that fuction. The use of this CC is to allow the users to pull up and view the Manuals for the systems installed at that site, but we don't want them to accidently print them (100s of pages). Please help, -G

    Read the article

  • .NET WPF Application : Loading a resourced .XPS document

    - by contactmatt
    I'm trying to load a .xps document into a DocumentViewer object in my WPF application. Everything works fine, except when I try loading a resourced .xps document. I am able to load the .xps document fine when using an absolute path, but when I try loading a resourced document it throws a "DirectoryNotFoundException" Here's an example of my code that loads the document. using System.Windows.Xps.Packaging; private void Window_Loaded(object sender, RoutedEventArgs e) { //Absolute Path works (below) //var xpsDocument = new XpsDocument(@"C:\Users\..\Visual Studio 2008\Projects\MyProject\MyProject\Docs\MyDocument.xps", FileAccess.Read); //Resource Path doesn't work (below) var xpsDocument = new XpsDocument(@"\MyProject;component/Docs/Mydocument.xps", FileAccess.Read); DocumentViewer.Document = xpsDocument.GetFixedDocumentSequence(); } When the DirectoryNotFoundException is thrown, it says "Could not find a part of the path : 'C:\MyProject;component\Docs\MyDocument.xps' It appears that it is trying to grab the .xps document from that path, as if it were an actual path on the computer, and not trying to grab from the .xps that is stored as a resource within the application.

    Read the article

  • WPF Documentviewerbase.Print. Remove dialog box

    - by Jim Beam
    I am using WPF and the DocumentViewer to display a document. However, when I use DocumentViewerBase.Print, it gives the "standard" Windows dialog box asking me to choose a printer with the default already selected. How can I get rid of this? I just want to use a Print method that will automatically start printing with no other prompt in between.

    Read the article

  • iphone calls both if and else at the same time?

    - by David Schiefer
    Hi, I need to determine what file type a file is and then perform a certain action for it. this seems to work fine for some types, however all media types such as videos and sound files get mixed up. I determine the file type by doing this: BOOL matchedMP3 = ([[rowValue pathExtension] isEqualToString:@"mp3"]); if (matchedMP3 == YES) { NSLog(@"Matched MP3"); } I do this for various file types and just define an "else" for all the others. Here's the problem though. The iPhone calls them both. Here's what the log reveals: 2010-05-11 18:51:12.421 Test [5113:207] Matched MP3 2010-05-11 18:51:12.449 Test [5113:207] Matched ELSE I've never seen anything like this before. This is my "matchedMP3" function: BOOL matchedMP3 = ([[rowValue pathExtension] isEqualToString:@"mp3"]); if (matchedMP3 == YES) { NSLog(@"Matched MP3"); NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSFileManager *manager = [NSFileManager defaultManager]; self.directoryContent = [manager directoryContentsAtPath:documentsDirectory]; NSString *errorMessage = [documentsDirectory stringByAppendingString:@"/"]; NSString *urlAddress = [errorMessage stringByAppendingString:rowValue]; MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:urlAddress]]; moviePlayer.movieControlMode = MPMovieControlModeDefault; moviePlayer.backgroundColor = [UIColor blackColor]; [moviePlayer play]; } and here's the else statement: else { NSLog(@"Matched ELSE"); [[NSUserDefaults standardUserDefaults] setObject:rowValue forKey:@"rowValue"]; NSString*rowValue = [[NSUserDefaults standardUserDefaults] objectForKey:@"rowValue"]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSFileManager *manager = [NSFileManager defaultManager]; self.directoryContent = [manager directoryContentsAtPath:documentsDirectory]; NSString *errorMessage = [documentsDirectory stringByAppendingString:@"/"]; NSString *urlAddress = [errorMessage stringByAppendingString:rowValue]; webViewHeader.prompt = rowValue; [documentViewer setDelegate:self]; NSString *encodedString = [urlAddress stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; //Create a URL object. NSURL *url = [NSURL URLWithString:encodedString]; //URL Requst Object NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; //Load the request in the UIWebView. [documentViewer loadRequest:requestObj]; [navigationController pushViewController:webView animated:YES]; } I can't see a reason why it wouldn't work. What happens is that both the webview and the MediaPlayer toggle their own player, so they overlap and play their sound/video a few secs apart from each other. Any help would be appreciated & thank for you taking the time to read through my code.

    Read the article

  • WPF and XPS: Empty Document Viewer

    - by xscape
    byte[] mediaBytes = Convert.FromBase64String("<<strings>>"); XpsDocument doc; ms = new MemoryStream(mediaBytes, 0, mediaBytes.Length); Uri DocumentUri = new Uri("pack://document.xps"); using (Package package = Package.Open(ms, FileMode.Create)) { PackageStore.AddPackage(DocumentUri, package); doc = new XpsDocument(package, CompressionOption.Maximum, DocumentUri.AbsoluteUri); FixedDocumentSequence fds = doc.GetFixedDocumentSequence(); documentViewer.Document = fds as IDocumentPaginatorSource; PackageStore.RemovePackage(DocumentUri); doc.Close(); } Can anyone please help me. Its result is an empty document. The mediaBytes is a PDF document.

    Read the article

  • How Do I Bind a "selected Item" in a Listbox to a ItemsControl in WPF?

    - by Scott
    LowDown: I am trying to create a Document Viewer in WPF. It will allow the user to preview selected documents and if they want, compare the documents in WPF. So they can view them side by side. The layout is this: Left side is a full list box. On the right side is a Collection or an Items control. Inside the items control will be a collection of the "selected documents" in the list box. So A user can select multiple items in the list box and for each new item they select, they can add the item to the collection on the right. I want the collection to look like a image gallery that shows up in Google/Bing Image searches. Make sense? The problem I am having is I can't get the WPFPreviewer to bind correctly to the selected item in the list box under the itemscontrol. Side Note: The WPFPreviewer is something Micorosft puts out that allows us to preview documents. Other previewers can be built for all types of documents, but im going basic here until I get this working right. I have been successful in binding to the list box WITHOUT the items control here: <Window.Resources> <DataTemplate x:Key="listBoxTemplate"> <StackPanel Margin="3" > <DockPanel > <Image Source="{Binding IconURL}" Height="30"></Image> <TextBlock Text=" " /> <TextBlock x:Name="Title" Text="{Binding Title}" FontWeight="Bold" /> <TextBlock x:Name="URL" Visibility="Collapsed" Text="{Binding Url}"/> </DockPanel> </StackPanel> </DataTemplate> </Window.Resources> <Grid Background="Cyan"> <ListBox HorizontalAlignment="Left" ItemTemplate="{StaticResource listBoxTemplate}" Width="200" AllowDrop="True" x:Name="lbDocuments" ItemsSource="{Binding Path=DocumentElements,ElementName=winDocument}" DragEnter="documentListBox_DragEnter" /> <l:WPFPreviewHandler Content="{Binding ElementName=lbDocuments, Path=SelectedItem.Url}"/> </Grid> Though, once I add in the ItemsControl, I can't get it to work anymore: <Window.Resources> <DataTemplate x:Key="listBoxTemplate"> <StackPanel Margin="3" > <DockPanel > <Image Source="{Binding IconURL}" Height="30"></Image> <TextBlock Text=" " /> <TextBlock x:Name="Title" Text="{Binding Title}" FontWeight="Bold" /> <TextBlock x:Name="URL" Visibility="Collapsed" Text="{Binding Url}"/> </DockPanel> </StackPanel> </DataTemplate> </Window.Resources> <Grid> <ListBox HorizontalAlignment="Left" ItemTemplate="{StaticResource listBoxTemplate}" Width="200" AllowDrop="True" x:Name="lbDocuments" ItemsSource="{Binding Path=DocumentElements,ElementName=winDocument}" DragEnter="documentListBox_DragEnter" /> <ItemsControl x:Name="DocumentViewer" ItemsSource="{Binding ElementName=lbDocuments, Path=SelectedItem.Url}" > <ItemsControl.ItemTemplate> <DataTemplate> <Grid Background="Cyan"> <l:WPFPreviewHandler Content="{Binding Url}"/> </Grid> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </Grid> Can someone please help me out with trying to bind to the ItemsControl if I select one or even multiple items in the listbox.

    Read the article

  • How to Bind a selected Item in a Listbox to a ItemsControl and ItemTemplate in WPF and C#

    - by Scott
    All, LowDown: I am trying to create a Document Viewer in WPF. The layout is this: Left side is a full list box. On the right side is a Collection or an Items control. Inside the items control will be a collection of the "selected documents" in the list box. So A user can select multiple items in the list box and for each new item they select, they can add the item to the collection on the right. I want the collection to look like a image gallery that shows up in Google/Bing Image searches. Make sense? The problem I am having is I can't get the WPFPreviewer to bind correctly to the selected item in the list box under the itemscontrol. Side Note: The WPFPreviewer is something Micorosft puts out that allows us to preview documents. Other previewers can be built for all types of documents, but im going basic here until I get this working right. I have been successful in binding to the list box WITHOUT the items control here: <Window.Resources> <DataTemplate x:Key="listBoxTemplate"> <StackPanel Margin="3" > <DockPanel > <Image Source="{Binding IconURL}" Height="30"></Image> <TextBlock Text=" " /> <TextBlock x:Name="Title" Text="{Binding Title}" FontWeight="Bold" /> <TextBlock x:Name="URL" Visibility="Collapsed" Text="{Binding Url}"/> </DockPanel> </StackPanel> </DataTemplate> </Window.Resources><Grid Background="Cyan"> <ListBox HorizontalAlignment="Left" ItemTemplate="{StaticResource listBoxTemplate}" Width="200" AllowDrop="True" x:Name="lbDocuments" ItemsSource="{Binding Path=DocumentElements,ElementName=winDocument}" DragEnter="documentListBox_DragEnter" /> <l:WPFPreviewHandler Content="{Binding ElementName=lbDocuments, Path=SelectedItem.Url}"/> </Grid> Though, once I add in the ItemsControl, I can't get it to work anymore: <Window.Resources> <DataTemplate x:Key="listBoxTemplate"> <StackPanel Margin="3" > <DockPanel > <Image Source="{Binding IconURL}" Height="30"></Image> <TextBlock Text=" " /> <TextBlock x:Name="Title" Text="{Binding Title}" FontWeight="Bold" /> <TextBlock x:Name="URL" Visibility="Collapsed" Text="{Binding Url}"/> </DockPanel> </StackPanel> </DataTemplate> </Window.Resources> <Grid> <ListBox HorizontalAlignment="Left" ItemTemplate="{StaticResource listBoxTemplate}" Width="200" AllowDrop="True" x:Name="lbDocuments" ItemsSource="{Binding Path=DocumentElements,ElementName=winDocument}" DragEnter="documentListBox_DragEnter" /> <ItemsControl x:Name="DocumentViewer" ItemsSource="{Binding ElementName=lbDocuments, Path=SelectedItem.Url}" > <ItemsControl.ItemTemplate> <DataTemplate> <Grid Background="Cyan"> <l:WPFPreviewHandler Content="{Binding Url}"/> </Grid> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </Grid> Can someone please help me out with trying to bind to the ItemsControl if I select one or even multiple items in the listbox.

    Read the article

1