pdf to image c# open source : Exporting pdf data to excel control SDK system web page wpf .net console fulton_fulton38-part549

mouseY=y;
//Hit Play
Next, we test for a hit test point inside each button by checking the bounds (right, left,
top, bottom) on the canvas to see whether the mouse pointer was over any of our buttons
when it was clicked. If so, we detect a hit.
Then, we test the play button. Notice that those variables we created to represent the
upper-left x and y locations of the button (playX and playY) help us make this calcu‐
lation. They also help us because the names of the buttons self-document what we are
trying to accomplish in each test of this function.
If the play button has been clicked and the video paused property is true, we call the
play() function of the video to start playing:
//Hit Play
if ( (mouseY >= playY) && (mouseY <= playY+bH) && (mouseX >= playX) &&
(mouseX <= playX+bW) ) {
if (videoElement.paused) {
videoElement.play();
}
If the stop button was clicked, we set the paused property of the video to true and set
the currentTime property to 0 so that the video will return to the first frame:
//Hit Stop
if ( (mouseY >= stopY) && (mouseY <= stopY+bH) && (mouseX >= stopX) &&
(mouseX <= stopX+bW) ) {
videoElement.pause();
videoElement.currentTime = 0;
}
If the pause button is clicked and the paused property of the video is false, we call the
pause() function of the video to—you guessed it—pause the video on the current frame.
If the paused property is true, we call the play() function of the video so that it will
resume playing:
//Hit Pause
if ( (mouseY >= pauseY) && (mouseY <= pauseY+bH) && (mouseX >= pauseX&&
(mouseX <= pauseX+bW) ) {
if (videoElement.paused == false) {
videoElement.pause();
else {
videoElement.play();
}
}
}
Video on the Canvas Examples  |  359
Exporting pdf data to excel - extract form data from PDF in C#.net, ASP.NET, MVC, Ajax, WPF
Help to Read and Extract Field Data from PDF with a Convenient C# Solution
extract data from pdf; online form pdf output
Exporting pdf data to excel - VB.NET PDF Form Data Read library: extract form data from PDF in vb.net, ASP.NET, MVC, Ajax, WPF
Convenient VB.NET Solution to Read and Extract Field Data from PDF
extract data from pdf to excel online; collect data from pdf forms
Figure 6-12 shows what the canvas looks like when the video is displayed with controls.
You will notice an odd relationship between the play and pause buttons.
When one is “on,” the other is “off.” This is because we have only one
property to look at: paused. There is a property named playing that
exists in the HTML5 specification, but it did not work in all browsers,
so we used only paused. In reality, you could have only one button and
swap out the play or paused graphic, depending on the paused state.
That would make these controls work more like the default HTML
video controls.
Figure 6-12. Canvas video player buttons
Example 6-11 shows the full source code for this application.
Example 6-11. Canvas video with controls
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CH6EX11: Canvas Video With Controls</title>
360  |  Chapter 6: Mixing HTML5 Video and Canvas
C# PDF Convert to Word SDK: Convert PDF to Word library in C#.net
PDF Library in C#.NET Class. Best C#.NET PDF to Microsoft Office Word converter SDK for exporting PDF to Word in Visual Studio .NET.
pdf form data extraction; save pdf forms in reader
C# PDF Convert to SVG SDK: Convert PDF to SVG files in C#.net, ASP
without quality loss. C# sample code for quick integration in .NET framework program for exporting PDF from SVG. In some situations
save data in pdf form reader; extract pdf form data to excel
<script src="modernizr.js"></script>
<script type="text/javascript">
window.addEventListener('load'eventWindowLoadedfalse);
var loadCount= 0;
var itemsToLoad = 2;
var videoElement;
var videoDiv;
var buttonSheet;
var buttonWait = 5;
var timeWaited = buttonWait;
function eventWindowLoaded() {
videoElement = document.createElement("video");
videoDiv = document.createElement('div');
document.body.appendChild(videoDiv);
videoDiv.appendChild(videoElement);
videoDiv.setAttribute("style""display:none;");
var videoType = supportedVideoFormat(videoElement);
if (videoType == "") {
alert("no video support");
return;
}
videoElement.addEventListener("canplay",itemLoaded,false);
videoElement.setAttribute("src""muirbeach." + videoType);
buttonSheet = new Image();
buttonSheet.onload = itemLoaded;
buttonSheet.src = "videobuttons.png";
}
function supportedVideoFormat(video) {
var returnExtension = "";
if (video.canPlayType("video/webm"=="probably" ||
video.canPlayType("video/webm"== "maybe") {
returnExtension = "webm";
else if(video.canPlayType("video/mp4") == "probably" ||
video.canPlayType("video/mp4"== "maybe") {
returnExtension = "mp4";
else if(video.canPlayType("video/ogg") =="probably" ||
video.canPlayType("video/ogg"== "maybe") {
returnExtension = "ogg";
}
return returnExtension;
}
function canvasSupport () {
return Modernizr.canvas;
}
function itemLoaded() {
loadCount++;
if (loadCount >= itemsToLoad) {
Video on the Canvas Examples  |  361
C# PDF Convert to Text SDK: Convert PDF to txt files in C#.net
Free evaluation library for exporting PDF to Text in both C#.NET WinForms application and ASP.NET WebForms. RasterEdge.XDoc.Excel.dll. RasterEdge.XDoc.PDF.dll.
edit pdf form in reader; pdf data extraction to excel
C# PDF Convert to Images SDK: Convert PDF to png, gif images in C#
NET. Support exporting PDF to multiple image forms, including Jpg, Png, Bmp, Gif, Tiff, Bitmap, .NET Graphics, and REImage. Support
export excel to pdf form; extract table data from pdf to excel
canvasApp();
}
}
function canvasApp() {
if (!canvasSupport()) {
return;
}
function  drawScreen () {
//Background
context.fillStyle = '#ffffaa';
context.fillRect(00theCanvas.width, theCanvas.height);
//Box
context.strokeStyle = '#000000';
context.strokeRect(5 5theCanvas.width-10, theCanvas.height-10);
//video
context.drawImage(videoElement , 8530);
//Draw Buttons
//Play
if (!videoElement.paused) {
context.drawImage(buttonSheet0,32,bW,bH,playX,playY,bW,bH); //Play Down
else {
context.drawImage(buttonSheet0,0,bW,bH,playX,playY,bW,bH); //Play up
}
if (videoElement.paused) {
context.drawImage(buttonSheet,  
32,32,bW,bH,pauseX,pauseY,bW,bH); // Pause down
else {
context.drawImage(buttonSheet 32,0,bW,bH,pauseX,pauseY,bW,bH); // Pause up
}
context.drawImage(buttonSheet 64,0,bW,bH,stopX,stopY,bW,bH); // Stop up
timeWaited++;
}
function eventMouseUp(event) {
if (timeWaited >= buttonWait) {
timeWaited = 0;
var mouseX;
var mouseY;
var x;
var y;
if (event.pageX || event.pageY) {
x = event.pageX;
y = event.pageY;
362  |  Chapter 6: Mixing HTML5 Video and Canvas
How to C#: Basic SDK Concept of XDoc.PDF for .NET
as annotation creating, deleting, modifying, importing, exporting, and so on. and events necessary to load a PDF document from file or query data and save
extracting data from pdf files; export pdf data to excel
VB.NET PDF: Basic SDK Concept of XDoc.PDF
as annotation creating, deleting, modifying, importing, exporting, and so on. and events necessary to load a PDF document from file or query data and save
cannot save pdf form in reader; how to save pdf form data in reader
else {
x = e.clientX + document.body.scrollLeft
+ document.documentElement.scrollLeft;
y = e.clientY + document.body.scrollTop
+ document.documentElement.scrollTop;
}
x -= theCanvas.offsetLeft;
y -= theCanvas.offsetTop;
mouseX=x;
mouseY=y;
//Hit Play
if ( (mouseY >= playY) && (mouseY <= playY+bH) && (mouseX >= playX) &&
(mouseX <= playX+bW) ) {
if (videoElement.paused) {
videoElement.play();
}
}
//Hit Stop
if ( (mouseY >= stopY) && (mouseY <= stopY+bH) && (mouseX >= stopX) &&
(mouseX <= stopX+bW) ) {
videoElement.pause();
videoElement.currentTime = 0;
}
//Hit Pause
if ( (mouseY >= pauseY&& (mouseY <= pauseY+bH) && (mouseX >= pauseX) &&
(mouseX <= pauseX+bW) ) {
if (videoElement.paused == false) {
videoElement.pause();
else {
videoElement.play();
}
}
}
}
var theCanvas = document.getElementById("canvasOne");
var context = theCanvas.getContext("2d");
var bW = 32;
var bH = 32;
var playX = 190;
var playY = 300;
var pauseX = 230;
Video on the Canvas Examples  |  363
C# Create PDF from images Library to convert Jpeg, png images to
Create PDF from images in both .NET WinForms and ASP.NET application. .NET converter control for exporting high quality PDF from images in C#.NET.
save data in pdf form reader; sign pdf form reader
VB.NET PDF - Convert PDF with VB.NET WPF PDF Viewer
Data. Data: Auto Fill-in Field Data. Field: Insert PDF, VB.NET Word, VB.NET Excel, VB.NET part illustrates some conversion tabs and features for PDF exporting.
export excel to pdf form; can reader edit pdf forms
var pauseY = 300;
var stopX = 270
var stopY = 300;
theCanvas.addEventListener("mouseup",eventMouseUpfalse);
function gameLoop() {
window.setTimeout(gameLoop20);
drawScreen();
}
gameLoop();}
</script>
</head>
<body>
<canvas id="canvasOne" width="500" height="350" style="position: absolute;
top: 50px; left: 50px;">
Your browser does not support HTML5 Canvas.
</canvas>
</body>
</html>
Animation Revisited: Moving Videos
Now we are going to revisit the bouncing balls demo from Chapter 5 to show you how
you can achieve the same effect with images and videos. Because we covered this in
detail in Example 5-5 (CH5EX5.html), we don’t need to examine all the code—just the
changes that make the videos move.
Remember that videos are drawn in much the same way as images, so
with very few changes, this application would work just as well with a
static image.
While there are a few other changes, the most important is in the drawScreen() function
when we draw the videos onto the canvas. Recall that in Chapter 5 we created an array
named balls and a dynamic object to hold the properties of each ball that looked like
this:
tempBall = {x:tempX,y:tempY,radius:tempRadiusspeed:tempSpeedangle:tempAngle,
xunits:tempXunitsyunits:tempYunits}
For videos, we will create a similar array, named videos, but we will alter the dynamic
object:
364  |  Chapter 6: Mixing HTML5 Video and Canvas
C# WPF PDF Viewer SDK to convert and export PDF document to other
Data. Data: Auto Fill-in Field Data. Field: Insert PDF, VB.NET Word, VB.NET Excel, VB.NET part illustrates some conversion tabs and features for PDF exporting.
extract data from pdf form; extract data from pdf into excel
VB.NET Create PDF from images Library to convert Jpeg, png images
REImage. .NET converter control for exporting high quality PDF from images. Turn multiple image formats into one or multiple PDF file.
saving pdf forms in acrobat reader; pdf data extraction tool
tempvideo = {x:tempX,y:tempY,width:180height:120speed:tempSpeed
angle:tempAngle,
xunits:tempXunitsyunits:tempYunits}
The big difference here is that we no longer need a radius that represents the size of
the ball; instead, we need the width and height so that we can render the video to our
desired size in the drawScreen() function.
In Chapter 5, we used the canvas drawing command to draw balls on the screen like
this:
context.beginPath();
context.arc(ball.x,ball.y,ball.radius,0,Math.PI*2,true);
context.closePath();
context.fill();
To draw videos, we need to change the code:
context.drawImage(videoElementvideo.xvideo.yvideo.widthvideo.height);
That is pretty much all you need to do! There are some other changes here (for example,
we start all the videos in the center of the screen before they start moving), but the items
mentioned above are the main things you need to concentrate on to move video, not
yellow balls, around the screen. Figure 6-13 shows what the example looks like with
bouncing videos instead of balls. You can see the full code in Example 6-12.
Animation Revisited: Moving Videos  |  365
Figure 6-13. Canvas video animation demo
Example 6-12. Multiple video bounce
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CH6EX12: Multiple Video Bounce</title>
<script src="modernizr.js"></script>
<script type="text/javascript">
window.addEventListener('load'eventWindowLoadedfalse);
var videoElement;
var videoDiv;
function eventWindowLoaded() {
videoElement = document.createElement("video");
var videoDiv = document.createElement('div');
366  |  Chapter 6: Mixing HTML5 Video and Canvas
document.body.appendChild(videoDiv);
videoDiv.appendChild(videoElement);
videoDiv.setAttribute("style""display:none;");
var videoType = supportedVideoFormat(videoElement);
if (videoType == "") {
alert("no video support");
return;
}
videoElement.addEventListener("canplaythrough",videoLoaded,false);
videoElement.setAttribute("src""muirbeach." + videoType);
}
function supportedVideoFormat(video) {
var returnExtension = "";
if (video.canPlayType("video/webm"=="probably" ||
video.canPlayType("video/webm"== "maybe") {
returnExtension = "webm";
else if(video.canPlayType("video/mp4") == "probably" ||
video.canPlayType("video/mp4"== "maybe") {
returnExtension = "mp4";
else if(video.canPlayType("video/ogg") =="probably" ||
video.canPlayType("video/ogg"== "maybe") {
returnExtension = "ogg";
}
return returnExtension;
}
function canvasSupport () {
return Modernizr.canvas;
}
function videoLoaded() {
canvasApp();
}
function canvasApp() {
if (!canvasSupport()) {
return;
}
function  drawScreen () {
context.fillStyle = '#000000';
context.fillRect(00theCanvas.width, theCanvas.height);
//Box
context.strokeStyle = '#ffffff';
context.strokeRect(1 1theCanvas.width-2, theCanvas.height-2);
Animation Revisited: Moving Videos  |  367
//Place videos
context.fillStyle = "#FFFF00";
var video;
for (var i =0; i <videos.length; i++) {
video = videos[i];
video.x += video.xunits;
video.y += video.yunits;
context.drawImage(videoElement ,video.x, video.yvideo.width, video.height);
if (video.x > theCanvas.width-video.width || video.x < 0 ) {
video.angle = 180 - video.angle;
updatevideo(video);
else if (video.y > theCanvas.height-video.height || video.y < 0) {
video.angle = 360 - video.angle;
updatevideo(video);
}
}
}
function updatevideo(video) {
video.radians = video.angle * Math.PI/ 180;
video.xunits = Math.cos(video.radians* video.speed;
video.yunits = Math.sin(video.radians* video.speed;
}
var numVideos = 12 ;
var maxSpeed = 10;
var videos = new Array();
var tempvideo;
var tempX;
var tempY;
var tempSpeed;
var tempAngle;
var tempRadians;
var tempXunits;
var tempYunits;
var theCanvas = document.getElementById("canvasOne");
var context = theCanvas.getContext("2d");
videoElement.play();
for (var i = 0i < numVideos; i++) {
tempX = 160 ;
tempY = 190 ;
tempSpeed = 5;
368  |  Chapter 6: Mixing HTML5 Video and Canvas
Documents you may be interested
Documents you may be interested