how to display pdf file in asp net using c# : Copy text from pdf to word application SDK tool html wpf asp.net online MATLAB_Excel5-part1906

Spectral Analysis Example
Spectral Analysis Example
This example illustrates the creation of a comprehensive Excel add-in to
perform spectral analysis. It requires knowledge of Visual Basic forms and
controls, as well as Excel workbook events. See the VBA documentation for a
complete discussion of these topics.
The example creates an Excel add-in that performs a fast Fourier transform
(FFT) on an input data set located in a designated worksheet range. The
function returns the FFT results, an array of frequency points, and the power
spectral density of the input data. It places these results into ranges you
indicate in the current worksheet. You can also optionally plot the power
spectral density.
You develop the function so that you can invoke it from the Excel Tools menu
and can select input and output ranges through a GUI.
Creating the add-in requires four basic steps:
1
Build a standalone COM component from MATLAB code.
2
Implement the necessary VBA code to collect input and dispatch the calls
to your component.
3
Create the G
UI.
4
Create an Excel add-in and package all necessary components for
application deployment.
Building the Component
Your component will have one class with two methods,
computefft
and
plotfft
. The
computefft
method computes the FFT and power spectral
density of the input data and computes a vector of frequency points based
on the length of the data entered and the sampling interval. The
plotfft
method performs the same operations as
computefft
,but also plots the
input data and the power spectral density in a MATLAB Figure window. The
MATLAB code for these two methods resides in two M-files,
computefft.m
and
plotfft.m
.
3-13
Copy text from pdf to word - extract text content from PDF file in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Feel Free to Extract Text from PDF Page, Page Region or the Whole PDF File
copy text from pdf to word with formatting; acrobat remove text from pdf
Copy text from pdf to word - VB.NET PDF Text Extract Library: extract text content from PDF file in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
How to Extract Text from PDF with VB.NET Sample Codes in .NET Application
copy and paste pdf text; copying text from pdf to excel
3
Usage Examples
computefft.m:
function [fftdata, freq, powerspect] = computefft(data, interval)
if (isempty(data))
fftdata = [];
freq = [];
powerspect = [];
return;
end
if (interval <= 0)
error('Sampling interval must be greater then zero');
return;
end
fftdata = fft(data);
freq = (0:length(fftdata)-1)/(length(fftdata)*interval);
powerspect = abs(fftdata)/(sqrt(length(fftdata)));
plotfft.m:
function [fftdata, freq, powerspect] = plotfft(data, interval)
[fftdata, freq, powerspect] = computefft(data, interval);
len = length(fftdata);
if (len <= 0)
return;
end
t = 0:interval:(len-1)*interval;
subplot(2,1,1), plot(t, data)
xlabel('Time'), grid on
title('Time domain signal')
subplot(2,1,2), plot(freq(1:len/2), powerspect(1:len/2))
xlabel('Frequency (Hz)'), grid on
title('Power spectral density')
To proceed with the actual building of the component, follow these steps:
1
If you have not already done so, execute the following command in
MATLAB:
mbuild -setup
Be sure to choose a supported compiler. See Supported Compilers at
http://www.mathworks.com/support/tech-notes/1600/1601.shtml
.
3-14
C# PDF Page Extract Library: copy, paste, cut PDF pages in C#.net
Ability to copy selected PDF pages and paste into The portable document format, known as PDF document, is a they are using different types of word processors.
copy formatted text from pdf; copy text from pdf with formatting
VB.NET PDF Convert to Word SDK: Convert PDF to Word library in vb.
VB.NET Tutorial for How to Convert PDF to Word (.docx) Document in VB.NET. using RasterEdge.XDoc.PDF; Convert PDF to Word Document in VB.NET Demo Code.
cut and paste pdf text; erase text from pdf file
Spectral Analysis Example
2
Create a project with the following settings.
Setting
Value
Component name
Fourier
Class name
Fourier
Project directory
The name of your work directory followed by the
component name.
Show verbose
output
Selected
3
Add the
computefft.m
and
plotfft.m
M-files to the project.
4
Save the project. Make note of the project directory because you will refer
to it later when you save your add-in.
5
Build the component by clicking the Build button in the Deployment Tool
toolbar.
Integrating the Component Using VBA
Having built your component, you can implement the necessary VBA code to
integrate it into Excel.
Selecting the Libraries
Follow these steps to open Excel and select the libraries you need to develop
the add-in:
1
Start Excel on your system.
2
From the Excel main menu, select Tools > Macro > Visual Basic Editor.
3
When the Visual Basic Editor starts, select Tools > References to open
the Project References dialog box.
4
Select Fourier 1.0 Type Library and MWComUtil 7.5 Type Library
from the list.
3-15
VB.NET PDF Page Extract Library: copy, paste, cut PDF pages in vb.
Extract, Copy, Paste PDF Pages. |. Home ›› XDoc.PDF ›› VB.NET PDF: Copy and Paste PDF Page. Ability to copy PDF pages and paste into another PDF file.
delete text from pdf file; extract text from pdf file
C# PDF Image Extract Library: Select, copy, paste PDF images in C#
PDF ›› C# PDF: Extract PDF Image. How to C#: Extract Image from PDF Document. Support PDF Image Extraction from a Page, a Region on a Page, and PDF Document.
extract highlighted text from pdf; cut text from pdf document
3
Usage Examples
Creating the Main VB Code Module for the Application. The add-in
requires some initialization code and some global variables to hold the
application’s state between function invocations. To achieve this, implement a
Visual Basic code module to manage these tasks, as follows:
1
Right-click the VBAProject item in the project window and click
Insert > Module.
Anew module appears under Modules in the VBA Project.
2
In the module’s property page, set the
Name
property to
FourierMain
.
See the next figure.
3
Enter the following code in the
FourierMain
module:
'
' FourierMain - Main module stores global state of controls
' and provides initialization code
'
3-16
VB.NET PDF Image Extract Library: Select, copy, paste PDF images
VB.NET PDF - Extract Image from PDF Document in VB.NET. Support PDF Image Extraction from a Page, a Region on a Page, and PDF Document in VB.NET Project.
extract text from pdf image; delete text from pdf online
C# Create PDF from Word Library to convert docx, doc to PDF in C#.
A convenient C#.NET control able to turn all Word text and image content into high quality PDF without losing formatting. Convert
get text from pdf image; extract text from pdf to word
Spectral Analysis Example
Public theFourier As Fourier.Fourierclass 'Global instance of Fourier object
Public theFFTData As MWComplex
'Global instance of MWComplex to accept FFT
Public InputData As Range
'Input data range
Public Interval As Double
'Sampling interval
Public Frequency As Range
'Output frequency data range
Public PowerSpect As Range
'Output power spectral density range
Public bPlot As Boolean
'Holds the state of plot flag
Public theUtil As MWUtil
'Global instance of MWUtil object
Public bInitialized As Boolean
'Module-is-initialized flag
Private Sub LoadFourier()
'Initializes globals and Loads the Spectral Analysis form
Dim MainForm As frmFourier
On Error GoTo Handle_Error
Call InitApp
Set MainForm = New frmFourier
Call MainForm.Show
Exit Sub
Handle_Error:
MsgBox (Err.Description)
End Sub
Private Sub InitApp()
'Initializes classes and libraries. Executes once
'for a given session of Excel
If bInitialized Then Exit Sub
On Error GoTo Handle_Error
If theUtil Is Nothing Then
Set theUtil = New MWUtil
Call theUtil.MWInitApplication(Application)
End If
If theFourier Is Nothing Then
Set theFourier = New Fourier.Fourierclass
End If
If theFFTData Is Nothing Then
Set theFFTData = New MWComplex
End If
bInitialized = True
Exit Sub
Handle_Error:
3-17
C# PDF Convert to Word SDK: Convert PDF to Word library in C#.net
key. Quick to remove watermark and save PDF text, image, table, hyperlink and bookmark to Word without losing format. Powerful components
copy pdf text to word with formatting; copy text from protected pdf to word
VB.NET Create PDF from Word Library to convert docx, doc to PDF in
Page: Replace PDF Pages. Page: Move Page Position. Page: Copy, Paste PDF Pages. Page: Rotate a PDF Page. PDF Read. Text: Extract Text from PDF. Text: Search
copy text from scanned pdf to word; copy pdf text to word document
3
Usage Examples
MsgBox (Err.Description)
End Sub
Creating the Visual Basic Form
The next step in the integration process develops a user interface for your
add-in using the Visual Basic Editor. Follow these steps to create a new user
form and populate it with the necessary controls:
1
Right-click VBAProject in the VBA project window and click
Insert > UserForm.
Anew form appears under
Forms
in the VBA project window.
2
In the form’s property page, set the
Name
property to
frmFourier
and the
Caption
property to
Spectral Analysis
.
3-18
VB.NET PDF copy, paste image library: copy, paste, cut PDF images
XDoc.PDF ›› VB.NET PDF: Copy, Paste, Cut Image in Page. VB.NET PDF - Copy, Paste, Cut PDF Image in VB.NET. VB.NET: Copy and Paste Image in PDF Page.
c# extract pdf text; get text from pdf file c#
Spectral Analysis Example
3
Add a series of controls to the blank form to complete the dialog box, as
summarized in the following table:
Controls Needed for Spectral Analysis Example
Control Type
Control Name
Properties
Purpose
CheckBox
chkPlot
Caption =
Plot time
domain signal
and power
spectral
density
Plots input
data and power
spectral density.
CommandButton
btnOK
Caption =
OK
Default = True
Executes the
function and
dismisses the
dialog box.
CommandButton
btnCancel
Caption =
Cancel
Cancel = True
Dismisses
the dialog
box without
executing the
function.
Frame
Frame1
Caption =
Input
Data
Groups all input
controls.
Frame
Frame2
Caption =
Output Data
Groups all
output controls.
Label
Label1
Caption =
Input
Data:
Labels the
RefEdit
for
input data.
TextBox
edtSample
N/A
N/A
Label
Label2
Caption =
Sampling
Interval
Labels the
TextBox
for
sampling
interval.
3-19
3
Usage Examples
Controls Needed for Spectral Analysis Example (Continued)
Control Type
Control Name
Properties
Purpose
Label
Label3
Caption =
Frequency:
Labels the
RefEdit
for
frequency
output.
Label
Label4
Caption =
FFT -
Real Part:
Labels the
RefEdit
for real
part of FFT.
Label
Label5
Caption =
FFT
- Imaginary
Part:
Labels the
RefEdit
for
imaginary part
of FFT.
Label
Label6
Caption
=
Power
Spectral
Density
Labels the
RefEdit
for
power spectral
density.
RefEdit
refedtInput
N/A
Selects range for
input data.
RefEdit
refedtFreq
N/A
Selects output
range for
frequency
points.
RefEdit
refedtReal
N/A
Selects output
range for real
part of FFT of
input data.
3-20
Spectral Analysis Example
Controls Needed for Spectral Analysis Example (Continued)
Control Type
Control Name
Properties
Purpose
RefEdit
refedtImag
N/A
Selects output
range for
imaginary part
of FFT of input
data.
RefEdit
refedtPowSpect N/A
Selects output
range for power
spectral density
of input data.
The following figure shows the controls layout on the form:
4
When the form and controls are complete, right-click the form and click
View Code.
The following code listing shows the code to implement. Notice that this
code references the control and variable names listed in Controls Needed
for Spectral Analysis Example on page 3-19. If you used different names
3-21
3
Usage Examples
for any of the controls or any global variable, change this code to reflect
those differences.
'
'frmFourier Event handlers
'
Private Sub UserForm_Activate()
'UserForm Activate event handler. This function gets called before
'showing the form, and initializes all controls with values stored
'in global variables.
On Error GoTo Handle_Error
If theFourier Is Nothing Or theFFTData Is Nothing Then Exit Sub
'Initialize controls with current state
If Not InputData Is Nothing Then
refedtInput.Text = InputData.Address
End If
edtSample.Text = Format(Interval)
If Not Frequency Is Nothing Then
refedtFreq.Text = Frequency.Address
End If
If Not IsEmpty (theFFTData.Real) Then
If IsObject(theFFTData.Real) And TypeOf theFFTData.Real Is Range Then
refedtReal.Text = theFFTData.Real.Address
End If
End If
If Not IsEmpty (theFFTData.Imag) Then
If IsObject(theFFTData.Imag) And TypeOf theFFTData.Imag Is Range Then
refedtImag.Text = theFFTData.Imag.Address
End If
End If
If Not PowerSpect Is Nothing Then
refedtPowSpect.Text = PowerSpect.Address
End If
chkPlot.Value = bPlot
Exit Sub
Handle_Error:
MsgBox (Err.Description)
End Sub
Private Sub btnCancel_Click()
3-22
Documents you may be interested
Documents you may be interested