Click here to Skip to main content
15,898,991 members

Comments by K N R (Top 56 by date)

K N R 23-Jun-14 5:49am View    
var numbers="";
for (var index = 0; index < 8; index++) {
if (permissions.indexOf($.trim(names.split(',')[index])) == -1) {
if (numbers == "") {
numbers += index;
} else {
numbers += "," + index;
}
}
}
$('#tabname').tabs({ collapsible: true, 'disabled': [numbers], active: true }).css({ 'font-size': 'smaller' })
K N R 25-Nov-13 1:13am View    
hi,
Thanks for you comment. OCR is very expensive tool. i have lacs of files to convert the other languages. is there any another way...??

Regards
K N R 5-Nov-13 7:55am View    
i already tried, but it's not working.
K N R 5-Nov-13 7:23am View    
Please include below code,


string inputFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "Test.pdf");
string outputFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "Output.pdf");

int Startpage=1;
int endpage=2;

PdfReader reader = null;
Document sourceDocument = null;
PdfCopy pdfCopyProvider = null;
PdfImportedPage importedPage = null;
try
{
// Intialize a new PdfReader instance with the contents of the source Pdf file:
reader = new PdfReader(sourcePdfPath);

// For simplicity, I am assuming all the pages share the same size
// and rotation as the first page:
sourceDocument = new Document(reader.GetPageSizeWithRotation(startPage));

// Initialize an instance of the PdfCopyClass with the source
// document and an output file stream:
pdfCopyProvider = new PdfCopy(sourceDocument,
new System.IO.FileStream(outputPdfPath, System.IO.FileMode.Create));

sourceDocument.Open();

// Walk the specified range and add the page copies to the output file:
for (int i = startPage; i <= endPage; i++)
{
importedPage = pdfCopyProvider.GetImportedPage(reader, i);

}

sourceDocument.Close();
reader.Close();
}
catch (Exception ex)
{
throw ex;
}
K N R 5-Nov-13 6:08am View    
Hi,

thanks for your comment. am using below code,

public void ExtractPages(string sourcePdfPath, string outputPdfPath, int startPage, int endPage)
{
PdfReader reader = null;
Document sourceDocument = null;
PdfCopy pdfCopyProvider = null;
PdfImportedPage importedPage = null;
try
{
reader = new PdfReader(sourcePdfPath);
sourceDocument = new Document(reader.GetPageSizeWithRotation(startPage));
pdfCopyProvider = new PdfCopy(sourceDocument,
new System.IO.FileStream(outputPdfPath, System.IO.FileMode.Create));
sourceDocument.Open();
for (int i = startPage; i <= endPage; i++)
{
importedPage = pdfCopyProvider.GetImportedPage(reader, i);
}
sourceDocument.Close();
reader.Close();
}
catch (Exception ex)
{
throw ex;
}
}

Please give me a suggestion, how to apply background color.