c# itext convert pdf to image : Change password on pdf file software control dll windows azure wpf web forms cips2ed65-part148

F.13. CODE LISTINGS FOR CHAPTER 13
629
/******************************************
*
*
new x = x.cos(a) - y.sin(a)
*
-m.cos(a) + m + n.sin(a)
*
*
new y = y.cos(a) + x.sin(a)
*
-m.sin(a) - n.cos(a) + n
*
*******************************************/
tmpx = (double)(j)*cosa
-
(double)(i)*sina
-
(double)(m)*cosa
+
(double)(m)
+
(double)(n)*sina;
tmpy = (double)(i)*cosa
+
(double)(j)*sina
-
(double)(m)*sina
-
(double)(n)*cosa
+
(double)(n);
new_j = tmpx;
new_i = tmpy;
if(bilinear == 0){
if(new_j < 0
||
new_j >= cols
||
new_i < 0
||
new_i >= rows)
out_image[i][j] = FILL;
else
out_image[i][j] =
the_image[new_i][new_j];
} /* ends if bilinear */
else{
out_image[i][j] =
bilinear_interpolate(the_image,
tmpx, tmpy,
rows, cols);
} /* ends bilinear if */
} /* ends loop over j */
} /* ends loop over i */
Change password on pdf file - C# PDF Password Library: add, remove, edit PDF file password in C#.net, ASP.NET, MVC, WinForms, WPF
Help to Improve the Security of Your PDF Document by Setting Password
password pdf files; convert password protected pdf to normal pdf online
Change password on pdf file - VB.NET PDF Password Library: add, remove, edit PDF file password in vb.net, ASP.NET, MVC, WinForms, WPF
Help to Improve the Security of Your PDF Document by Setting Password
pdf password remover; pdf password encryption
630
APPENDIX F. SOURCE CODE LISTINGS
} /* ends arotate */
/*******************************************
*
*
bilinear_interpolate(..
*
*
This routine performs bi-linear
*
interpolation.
*
*
If x or y is out of range, i.e. less
*
than zero or greater than rows or cols,
*
this routine returns a zero.
*
*
If x and y are both in range, this
*
routine interpolates in the horizontal
*
and vertical directions and returns
*
the proper gray level.
*
*******************************************/
bilinear_interpolate(the_image, x, y, rows, cols)
double x, y;
long
cols, rows;
short **the_image;
{
double fraction_x, fraction_y,
one_minus_x, one_minus_y,
tmp_double;
int
ceil_x, ceil_y, floor_x, floor_y;
short p1, p2, p3, result = FILL;
/******************************
*
*
If x or y is out of range,
*
return a FILL.
*
*******************************/
if(x < 0.0
||
x >= (double)(cols-1)
||
y < 0.0
||
Online Change your PDF file Permission Settings
to make it as easy as possible to change your PDF You can receive the locked PDF by simply clicking download and If we need a password from you, it will not be
password pdf; copy from protected pdf
VB.NET PDF File Compress Library: Compress reduce PDF size in vb.
list below is mainly to optimize PDF file with multiple Program.RootPath + "\\" 3_optimized.pdf"; 'create optimizing 150.0F 'to change image compression
add password to pdf; pdf file password
F.13. CODE LISTINGS FOR CHAPTER 13
631
y >= (double)(rows-1))
return(result);
tmp_double = floor(x);
floor_x
= tmp_double;
tmp_double = floor(y);
floor_y
= tmp_double;
tmp_double = ceil(x);
ceil_x
= tmp_double;
tmp_double = ceil(y);
ceil_y
= tmp_double;
fraction_x = x - floor(x);
fraction_y = y - floor(y);
one_minus_x = 1.0 - fraction_x;
one_minus_y = 1.0 - fraction_y;
tmp_double = one_minus_x *
(double)(the_image[floor_y][floor_x]) +
fraction_x *
(double)(the_image[floor_y][ceil_x]);
p1
= tmp_double;
tmp_double = one_minus_x *
(double)(the_image[ceil_y][floor_x]) +
fraction_x *
(double)(the_image[ceil_y][ceil_x]);
p2
= tmp_double;
tmp_double = one_minus_y * (double)(p1) +
fraction_y * (double)(p2);
p3
= tmp_double;
return(p3);
} /* ends bilinear_interpolate */
#ifdef NEVER
/*******************************************
*
C# PDF File Compress Library: Compress reduce PDF size in C#.net
list below is mainly to optimize PDF file with multiple Program.RootPath + "\\" 3_optimized.pdf"; // create optimizing 150F; // to change image compression
pdf password online; add password to pdf online
Online Remove password from protected PDF file
Online Remove Password from Protected PDF file. Download Free Trial. Remove password from protected PDF file. Find your password-protected PDF and upload it.
pdf password security; password on pdf
632
APPENDIX F. SOURCE CODE LISTINGS
*
get_geometry_options(..
*
*
This routine interacts with the user
*
to obtain the parameters to call the
*
geometry operations subroutines.
*
*******************************************/
get_geometry_options(operation, angle,
x_displace, y_displace,
x_stretch, y_stretch,
x_cross, y_cross,
bilinear, m, n)
char operation[];
int
*bilinear;
short *m, *n, *x_displace, *y_displace;
float *angle,
*x_cross, *y_cross,
*x_stretch, *y_stretch;
{
int not_finished, response;
not_finished = 1;
while(not_finished){
printf("\nThe geomety options are:");
printf("\n\t1. Operation is %s", operation);
printf("\n\t2. Angle is %f", *angle);
printf("\n\t3. x-displace=%d y-displace=%d",
*x_displace, *y_displace);
printf("\n\t4. x-stretch=%f y-stretch=%f",
*x_stretch, *y_stretch);
printf("\n\t5. x-cross=%f y-cross=%f",
*x_cross, *y_cross);
printf("\n\t6. bilinear = %d", *bilinear);
printf("\n\t7. rotation points m=%d n=%d",
*m, *n);
printf("\n\nExamples:");
printf("\ngeometry needs: angle");
printf(" x-displace y-displace");
printf(" x-stretch y-stretch");
printf("\n
x-cross y-cross");
printf(" bilinear (1 or 0)");
printf("\nrotate needs: angle m n");
printf(" bilinear (1 or 0)");
printf("\n\nEnter choice (0 = no change) _\b");
C# PDF Page Rotate Library: rotate PDF page permanently in C#.net
C#.NET PDF Library - Rotate PDF Page in C#.NET. Empower C# Users to Change the Rotation Angle of PDF File Page Using C# Programming Language in .NET Application
convert protected pdf to word document; break password pdf
C# PDF File Permission Library: add, remove, update PDF file
to PDF; Merge PDF Files; Split PDF Document; Remove Password from PDF; Change PDF Permission Settings. C#: Convert PDF to Jpeg; C# File: Compress PDF; C# File
pdf protected mode; copy protected pdf to word converter online
F.13. CODE LISTINGS FOR CHAPTER 13
633
get_integer(&response);
if(response == 0)
not_finished = 0;
if(response == 1){
printf("\nEnter operation:");
gets(operation);
} /* ends if 1 */
if(response == 2){
printf("\nEnter angle: ___\b\b\b");
get_float(angle);
} /* ends if 2 */
if(response == 3){
printf("\nEnter x-displace: ___\b\b\b");
get_integer(x_displace);
printf("\nEnter y-displace: ___\b\b\b");
get_integer(y_displace);
} /* ends if 3 */
if(response == 4){
printf("\nEnter x-stretch: ___\b\b\b");
get_float(x_stretch);
printf("\nEnter y-stretch: ___\b\b\b");
get_float(y_stretch);
} /* ends if 4 */
if(response == 5){
printf("\nEnter x-cross: ___\b\b\b");
get_float(x_cross);
printf("\nEnter y-cross: ___\b\b\b");
get_float(y_cross);
} /* ends if 5 */
if(response == 6){
printf("\nEnter bilinear: _\b");
get_integer(bilinear);
} /* ends if 6 */
if(response == 7){
printf("\nEnter rotation point m: _\b");
get_integer(m);
printf("\nEnter rotation point n: _\b");
VB.NET PDF File Permission Library: add, remove, update PDF file
to PDF; Merge PDF Files; Split PDF Document; Remove Password from PDF; Change PDF Permission Settings. C#: Convert PDF to Jpeg; C# File: Compress PDF; C# File
protected pdf; pdf password unlock
C#: How to Draw and Customize Annotation in HTML5 Document Viewer
to PDF; Merge PDF Files; Split PDF Document; Remove Password from PDF; Change PDF Permission Settings. C#: Convert PDF to Jpeg; C# File: Compress PDF; C# File
create pdf password; adding a password to a pdf
634
APPENDIX F. SOURCE CODE LISTINGS
get_integer(n);
} /* ends if 7 */
} /* ends while not_finished */
} /* ends get_geometry_options */
#endif
Listing 13.1 - The Geometry Subroutines
/********************************************
*
*
file d:\cips\geometry.c
*
*
Functions: This file contains
*
main
*
*
Purpose:
*
This file contains the main calling
*
routine for geometric subroutines.
*
*
External Calls:
*
imageio.c - create_image_file
*
read_image_array
*
write_image_array
*
get_image_size
*
allocate_image_array
*
free_image_array
*
geosubs.c - geometry
*
arotate
*
*
Modifications:
*
26 October 1993 - created
*
27 August 1998 - modified to work on
*
entire images at once.
*
19 September 1998 - modified to work with
*
all I O routines in imageio.c.
*
********************************************/
F.13. CODE LISTINGS FOR CHAPTER 13
635
#include "cips.h"
short **the_image;
short **out_image;
main(argc, argv)
int argc;
char *argv[];
{
char
name1[80], name2[80], type[80];
float theta, x_stretch, y_stretch,
x_cross, y_cross;
int
bilinear;
int
x_control, y_control;
long
length, width;
short m, n, x_displace, y_displace;
/*************************************
*
*
This program will use a different
*
command line for each type of
*
call.
*
*
Print a usage statement that
*
gives an example of each type
*
of call.
*
*************************************/
if(argc < 7){
printf("\n\nNot enough parameters:");
printf("\n");
printf("\n
Two Operations: ");
printf("\n
geometry rotate");
printf("\n\n
Examples:");
printf("\n");
printf("\n
geometry in out geometry angle");
printf(" x-displace y-displace");
printf("\n
x-stretch y-stretch");
printf(" x-cross y-cross bilinear (1 or 0)");
printf("\n");
printf("\n
geometry in out rotate angle m n");
636
APPENDIX F. SOURCE CODE LISTINGS
printf(" bilinear (1 or 0)");
printf("\n");
exit(0);
}
/*************************************
*
*
Interpret the command line
*
depending on the type of call.
*
*************************************/
if(strncmp(argv[3], "geometry", 3) == 0){
strcpy(name1, argv[1]);
strcpy(name2, argv[2]);
strcpy(type, argv[3]);
theta
= atof(argv[4]);
x_displace = atoi(argv[5]);
y_displace = atoi(argv[6]);
x_stretch = atof(argv[7]);
y_stretch = atof(argv[8]);
x_cross
= atof(argv[9]);
y_cross
= atof(argv[10]);
bilinear
= atoi(argv[11]);
}
if(strncmp(argv[3], "rotate", 3) == 0){
strcpy(name1, argv[1]);
strcpy(name2, argv[2]);
strcpy(type, argv[3]);
theta
= atof(argv[4]);
m
= atoi(argv[5]);
n
= atoi(argv[6]);
bilinear = atoi(argv[7]);
}
if(does_not_exist(name1)){
printf("\nERROR input file %s does not exist",
name1);
exit(0);
}
get_image_size(name1, &length, &width);
the_image = allocate_image_array(length, width);
F.13. CODE LISTINGS FOR CHAPTER 13
637
out_image = allocate_image_array(length, width);
create_image_file(name1, name2);
read_image_array(name1, the_image);
/*************************************
*
*
Call the routines
*
*************************************/
if(strncmp(type, "geometry", 3) == 0){
geometry(the_image, out_image,
theta, x_stretch, y_stretch,
x_displace, y_displace,
x_cross, y_cross,
bilinear,
length,
width);
} /* ends if */
if(strncmp(type, "rotate", 3) == 0){
arotate(the_image, out_image,
theta, m, n, bilinear,
length,
width);
} /* ends if */
write_image_array(name2, out_image);
free_image_array(out_image, length);
free_image_array(the_image, length);
} /* ends main */
Listing 13.2 - The geometry Program
/********************************************
*
638
APPENDIX F. SOURCE CODE LISTINGS
*
file stretch.c
*
*
Functions: This file contains
*
main
*
stretch
*
bilinear_interpolate
*
*
Purpose:
*
This file contains the main calling
*
routine and the needed subroutines
*
for a program which stretches
*
an image by any factor. It can either
*
roundoff the numbers or use
*
bi-linear interpolation.
*
*
External Calls:
*
imageio.c - create_resized_image_file
*
read_image_array
*
write_image_array
*
get_image_size
*
allocate_image_array
*
free_image_array
*
*
Modifications:
*
4 December 1993 - created
*
16 September 1998 - modified to work on entire
*
images at one time.
*
22 September 1998 - modified to work with
*
all I O routines in imageio.c.
*
*********************************************/
#include "cips.h"
#define FILL 150
short **the_image;
short **out_image;
main(argc, argv)
int argc;
char *argv[];
{
char
in_name[80], out_name[80];
Documents you may be interested
Documents you may be interested