convert pdf page to image c# itextsharp : Change password on pdf file software Library dll windows asp.net winforms web forms cips2ed70-part154

F.15. CODE LISTINGS FOR CHAPTER 15
679
/**************************************
*
*
Free the memory for the
*
two dimensional small array.
*
***************************************/
for(i=0; i<size; i++)
free(small[i]);
} /* ends compare */
Listing 15.1 - The Texture Subroutines
/********************************************
*
*
file texture.c
*
*
Functions: This file contains
*
main
*
*
Purpose:
*
This file contains the main calling
*
routine for texture subroutines.
*
*
External Calls:
*
imageio.c - create_image_file
*
read_image_array
*
write_image_array
*
get_image_size
*
get_bitsperpixel
*
allocate_image_array
*
free_image_array
*
txtrsubs.c - sigma
*
skewness
*
amean
*
adifference
*
hurst
*
compare
*
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
copy protecting pdf files; pdf password protect
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
convert password protected pdf to normal pdf; a pdf password online
680
APPENDIX F. SOURCE CODE LISTINGS
*
Modifications:
*
12 August 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.
*
********************************************/
#include "cips.h"
short **the_image;
short **out_image;
main(argc, argv)
int argc;
char *argv[];
{
char name1[80], name2[80];
int size, t, type, v;
long bits_per_pixel, length, width;
if(argc < 7){
show_texture_usage();
exit(0);
}
strcpy(name1, argv[1]);
strcpy(name2, argv[2]);
t
= atoi(argv[4]);
v
= atoi(argv[5]);
size = atoi(argv[6]);
if(does_not_exist(name1)){
printf("\nERROR input file %s does not exist",
name1);
exit(0);
}
get_image_size(name1, &length, &width);
get_bitsperpixel(name1, &bits_per_pixel);
the_image = allocate_image_array(length, width);
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
convert password protected pdf to word; create copy 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
adding a password to a pdf file; convert password protected pdf files to word online
F.15. CODE LISTINGS FOR CHAPTER 15
681
out_image = allocate_image_array(length, width);
create_image_file(name1, name2);
read_image_array(name1, the_image);
if(strncmp(argv[3], "compare", 3) == 0){
read_image_array(name1, out_image);
compare(the_image, out_image,
t, v, size,
length,
width,
bits_per_pixel);
} /* ends if compare case */
if(strncmp(argv[3], "hurst", 3) == 0)
hurst(the_image, out_image,
size,
length,
width,
bits_per_pixel);
if(strncmp(argv[3], "adifference", 3) == 0)
adifference(the_image,
out_image,
size,
length,
width);
if(strncmp(argv[3], "amean", 3) == 0)
amean(the_image, out_image,
size,
length,
width,
bits_per_pixel);
if(strncmp(argv[3], "skewness", 3) == 0){
size = atoi(argv[4]);
t
= atoi(argv[5]);
v
= atoi(argv[6]);
skewness(the_image, out_image,
size, t, v,
length,
width,
bits_per_pixel);
} /* ends skewness case */
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
add password to pdf online; pdf security password
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.
convert protected pdf to word; create password protected pdf from word
682
APPENDIX F. SOURCE CODE LISTINGS
if(strncmp(argv[3], "sigma", 3) == 0){
size = atoi(argv[4]);
t
= atoi(argv[5]);
v
= atoi(argv[6]);
sigma(the_image, out_image,
size, t, v,
length,
width,
bits_per_pixel);
} /* ends sigma case */
write_image_array(name2, out_image);
free_image_array(out_image, length);
free_image_array(the_image, length);
} /* ends main */
show_texture_usage()
{
printf("\n\nNot enough parameters:");
printf("\n");
printf("\n
usage: texture in-file out-file type ");
printf("threshold? threshold-value size");
printf("\n
recall type: sigma
skewness");
printf("\n
amean
adifference");
printf("\n
hurst
compare");
printf("\n
threshold?
1-threshold on");
printf("\n
2-threshold off\n");
printf("\n
usage for compare:");
printf("\n
texture in-file out-file compare ");
printf("line element size");
printf("\n "
"\ntexture in-file out-file compare line element size"
"\ntexture in-file out-file hurst x x size (3 5 or 7)"
"\ntexture in-file out-file adifference x x size"
"\ntexture in-file out-file amean x x size"
"\ntexture in-file out-file skewness size "
"threshold(0,1) high-threshold"
"\ntexture in-file out-file sigma size "
"threshold(0,1) high-threshold");
}
Listing 15.2 - The texture Program
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 online; a pdf password
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; open password protected pdf
F.16. CODE LISTINGS FOR CHAPTER 16
683
F.16 Code Listings for Chapter 16
/***********************************************
*
* file cstereo.c
*
* Functions: This file contains
*
main
*
fill_line
*
initialize_pattern
*
lengthen_pattern
*
no_change
*
shorten_pattern
*
get_random_values
*
random_substitution
*
test_print_line
*
* Purpose:
*
This file contains a program that will
*
make character based stereograms.
*
* External Calls:
*
none
*
* Modifications:
*
7 February 1995 - created
*
*************************************************/
#include "cips.h"
#define PATTERN_START 48 /* the zero character
*/
#define PATTERN_END
122 /* the small z character */
#define KONSTANT
2
#define ASCII_SIZE
256
void fill_line();
void initialize_pattern();
void lengthen_pattern();
void no_change();
void shorten_pattern();
void get_random_values();
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
pdf password unlock; pdf user password
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
copy from protected pdf; password on pdf
684
APPENDIX F. SOURCE CODE LISTINGS
void random_substitution();
void test_print_line();
main(argc, argv)
char *argv[];
int argc;
{
char *depth_line,
*pattern,
*processed_pattern,
*pdest,
response[80];
char last_character,
this_character;
FILE *depth_file,
*processed_pattern_file,
*stereo_file;
int current_width,
j,
index,
location,
max_width,
pattern_width,
pp_index,
width;
if(argc != 6){
printf(
"\nusage: cstereo pattern-width width-of-line"
"\n
depth-file-name "
"stereo-file-name "
"\n
processed-pattern-file-name"
"\n");
exit(1);
}
pattern_width = atoi(argv[1]);
width
= atoi(argv[2]);
pattern
= malloc(KONSTANT*width);
depth_line
= malloc(KONSTANT*width);
F.16. CODE LISTINGS FOR CHAPTER 16
685
processed_pattern = malloc(KONSTANT*width);
if((depth_file = fopen(argv[3], "rt")) == NULL){
printf(
"\ncstereo: Error opening input file %s\n",
argv[3]);
exit(3);
}
if((stereo_file = fopen(argv[4], "wt")) == NULL){
printf(
"\ncstereo: Error opening output file %s\n",
argv[4]);
exit(4);
}
if((processed_pattern_file =
fopen(argv[5], "wt")) == NULL){
printf(
"\ncstereo: Error opening temp file %s\n",
argv[5]);
exit(5);
}
/******************************************
*
*
This is the major loop of the program.
*
It reads one line at a time from the
*
depth file, processes that one line,
*
and writes the resulting pattern to the
*
processed pattern file.
*
******************************************/
while(fgets(depth_line,
KONSTANT*width,
depth_file)){
fill_line(pattern, KONSTANT*width);
fill_line(processed_pattern, KONSTANT*width);
initialize_pattern(pattern,
&current_width,
&max_width,
pattern_width,
686
APPENDIX F. SOURCE CODE LISTINGS
&index);
/*******************************************
*
*
Loop through the characters in the
*
depth_line. Call one of the three
*
processing routines based on the
*
relationship between the last character
*
and this character.
*
*******************************************/
last_character = depth_line[0];
pp_index = 0;
for(j=0; j<width; j++){
this_character = depth_line[j];
if(this_character == ’\n’)
this_character = last_character;
if(this_character > last_character)
shorten_pattern(
(this_character-last_character),
pattern, &index, &current_width,
width);
if(this_character < last_character)
lengthen_pattern(
(last_character-this_character),
pattern, &index, &current_width,
&width, &max_width);
/****************************************
*
*
Perform the no_change in every
*
pass. Do it after you have done
*
the shorten and lenghten pattern.
*
****************************************/
F.16. CODE LISTINGS FOR CHAPTER 16
687
no_change(pattern, processed_pattern,
pp_index, current_width, &index);
pp_index++;
last_character = depth_line[j];
} /* ends loop over j */
pdest
= strchr(processed_pattern, ’\0’);
location = pdest - processed_pattern;
processed_pattern[location] = ’\n’;
fputs(processed_pattern,
processed_pattern_file);
random_substitution(processed_pattern, width);
fputs(processed_pattern, stereo_file);
}
/* ends the major loop */
fclose(depth_file);
fclose(processed_pattern_file);
fclose(stereo_file);
free(pattern);
free(depth_line);
free(processed_pattern);
return(111);
} /* ends main
*/
/***********************************************
*
*
shorten_pattern(...
*
*
This funtion shortens the pattern by
*
deleting an element from it. For example,
*
if the input pattern is abcdefg,
*
the output pattern could be abcfg.
*
688
APPENDIX F. SOURCE CODE LISTINGS
***********************************************/
void shorten_pattern(size, pattern, index,
current_width, width)
char *pattern;
int size, *index, *current_width, width;
{
char *temp_pattern;
int i, new_index, new_width;
temp_pattern = malloc(KONSTANT*width);
for(i=0; i<width; i++)
temp_pattern[i] = pattern[i];
fill_line(pattern, width);
new_index = 0;
new_width = *current_width - size;
/*********************************************
*
*
Increase the index by the amount we want
*
to shorten the pattern.
Then copy the
*
temp_pattern back to the pattern skipping
*
over parts of the pattern by the amount
*
we want to shorten it.
*
*********************************************/
*index = (*index + size) % (*current_width);
for(new_index=0; new_index<new_width; new_index++){
pattern[new_index] = temp_pattern[*index];
*index = *index + 1;
if(*index >= *current_width)
*index = 0;
} /* ends loop over new_index */
*current_width = new_width;
*index
= 0;
free(temp_pattern);
} /* ends shorten_pattern */
Documents you may be interested
Documents you may be interested