I am trying to load a pdf into a axAcroPDF using this method that I found here. but there isn't a this.axAcroPDF.LoadFile() there. The error message that I get says:
"AxacroPDFLib.AxacroPDF doesn't contain a defection for 'LoadFile' and
no Extension method excepting first method of a type
AxacroPDFLib.AxacroPDF could be found (Are you missing a using
directive or an assembly reference?"
So I double checked and there are Acrobat , AcroPDFLib, AxAcroPDFLib Referances in the WPF and user control.
Next I goggled this again and found this on YouTube that uses this.axAcroPDF.src =path; however I do not this option either. Please tell me if they have changed the LoadFile(path) to something else, or if there is a reference that I am missing?
axAcroPDF1.LoadFile(PDFPath.ToString());
axAcroPDF1.setShowToolbar(false); //disable pdf toolbar.
axAcroPDF1.Enabled = true;
Another solution is to set the src property of your Axacro control.
Related
I've successfully been able to use a static .svg file as an image in WPF by following the guidance in another question.
The basic approach there is to use the SharpVectors library, and do:
<svgc:SvgViewbox Source="path/to/file.svg"/>
In place of an <Image .../> tag.
However I am struggling trying to find a similar method to use an SVG within a System.Windows.Controls.Ribbon - where i'd like to use it as the SmallImageSource of a RibbonMenuButton.
I have tried the following:
<RibbonMenuButton Label="Test">
<RibbonMenuButton.SmallImageSource>
<svgc:SvgViewbox Source="path/to/file.svg"/>
</RibbonMenuButton.SmallImageSource>
</RibbonMenuButton>
Which produces the compiler error message:
The specified value cannot be assigned. The following type was
expected: "ImageSource".
I think the key problem is that an svgc:SvgViewBox is not an "image source", but I don't know how to properly convert or otherwise work around this.
I'm open to alternate approaches which don't use SharpVectors, but it is extremely convenient to have source image files in SVG format and not have to manually convert to any other format.
SharpVectors includes a converter extension which can be used to 'output' an ImageSource.
This is documented in section "1.2 WPF Extensions and Type Converters" of their usage guidelines.
Example:
<RibbonMenuButton Label="Test" LargeImageSource="{svgc:SvgImage path/to/file.svg}"/>
(where svgc is the defined name of the SharpVectors namespace in your XAML.)
The svgc:SvgImage binding extension produces a DrawingImage which is a type of ImageSource. This works perfectly at runtime with the SVG image rendered into the button.
Unfortunately at design-time the button image is blank.
Please try using the newly added property; AppName, which is used to try and resolve the URI of the resource file at design-time.
See the samples for the SvgImage and newly added SvgImageConverter, especially the toolbar demo using the SVG icons.
https://github.com/ElinamLLC/SharpVectors/tree/master/TutorialSamples/ControlSamplesWpf
SvgImageConverter provides binding support, if you need it unlike the SvgImage.
I have a function (I inherited the code and am new to .Net) that is defined as
private void setTextBoxes(DataView dv, FCKeditor txtField, HiddenField hidField)
We were using the ckEditorv2 (FckEditorv2), but due to incompatibility issues they want to go to just use the ajaxcontroltoolkit htmleditor. I cannot figure out what to put in place of FCKEditor in the above code call. I have tried various things like HTMLEditor, ajaxeditor and cannot figure what this is really pulling and how I access it or replace it with the ajax control instead of the FCKEditor control.
Thank you for any help you can give me.
wb
ANSWER:
It turns out I was not using the correct collection. I was using AjaxControlToolKit and I needed to (perhaps also) use AjaxControlToolKit.HTMLEditor. Once I used that collection it recognized Editor as the correct parameter type and then I just had to clean up the code (such as AjaxControlToolKit does not have .value, it is .content) and it works!
ANSWER: It turns out I was not using the correct collection. I was using AjaxControlToolKit and I needed to (perhaps also) use AjaxControlToolKit.HTMLEditor. Once I used that collection it recognized Editor as the correct parameter type and then I just had to clean up the code (such as AjaxControlToolKit does not have .value, it is .content) and it works!
I can't seem to get the Home button in my wpf web browser to work. Do you guys have any idea?
I have tried:
WebBrowser1.GoHome();
But I'm reciving:
'System.Windows.Controls.WebBrowser' does not contain a definition for 'GoHome' and no extension method 'GoHome' accepting a first argument of type 'System.Windows.Controls.WebBrowser' could be found (are you missing a using directive or an assembly reference?)
However, other commands are working just fine, for example:
WebBrowser1.GoBack();
Try to assign a set URL to the button/save the location as a file. Consider it more like a bookmark:
string input = Microsoft.VisualBasic.Interaction.InputBox("Please set your home page", "Settings");
WebBrowser1.Navigate(Registry.GetValue(#"HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Start Page", "").ToString());
That will work for IE, for any other browser it gets...complicated...
I have a xaml page samplePage.xaml and its corresponding .cs file samplePage.xaml.cs. In this page there is a textBox textBox1.
Now I create an instance of the page:
PhoneApp1.samplePage s = new PhoneApp1.samplePage();
and after that, I would like to set the value in the text box by calling:
s.textBox1.Text = "whatever"
but it turns out there is an error message saying
'PhoneApp1.samplePage' does not contain a definition for 'textBox1'
and no extension method 'textBox1' accepting a first argument of type
PhoneApp1.samplePage' could be found (are you missing a using
directive or an assembly reference?)
I would like to know how to get the xaml element using C# code?
You textbox is probably private or protected. Add a wrapper in your page to expose the textbox, something like :
public TextBox TextBox1
{
get
{
return this.textBox1;
}
}
(mind the case)
Then just use the property from anywhere you want: s.TextBox1.Text = "whatever";
Good question, you'll need to use XamlReader.Load to load your page/control at runtime, then you'll be able to access the controls within it:
http://msdn.microsoft.com/en-us/library/cc189076(v=vs.95).aspx#using_xamlreaderload
http://blogs.silverlight.net/blogs/msnow/archive/2008/10/09/silverlight-tip-of-the-day-60-how-to-load-a-control-straight-from-xaml.aspx
I'm trying to add a radio button to a pdf page I'm rendering through abcpdf. I'm looking at the documentation for abcpdf and it specifies that I use the following code
Doc theDoc = new Doc();
InteractiveForm form = new InteractiveForm (theDoc);
form.AddRadioButtonGroup(new string[2]{"40 610 80 650", "40 660 80 700"}, "RadioGroupField", 0);
The problem is that I don't know what assembly InteractiveForm is referencing so the compiler will error on that line. If I simply add a radiobutton to the html page I'm rendering, it will appear in the pdf but will not be able to be interacted with. Does anyone know what I can use to get InteractiveForm to work, or some other workaround? Thanks in advance.
When you download and install the full .Net package one of the example projects is called Annotations. Within this project is a file called Annotations.cs that has the classes that you're looking for.