Thank you for your response.
But our problem is not solved.
Here is the exact description of our problem with 2 scenarios
1)PDF Document to PDF
compliant :
As per our requirement we need to convert pdf document(remember.. existing PDF file) to pdfacompliant for
that we have used below method which is not working.
//create a FileStream object for Pdf file
FileStream fs = new
FileStream(@"C:\PdfTestFile.Pdf",
FileMode.Open);
Pdf objPDF = new
Pdf();
//Set the conformance property of Pdf class to
predefined value
objPDF.Conformance = PdfConformance.PdfA1A;
//Add a section into the pdf document
Aspose.Pdf.Section section =
objPDF1.Sections.Add();
//Create an image object in the
section
Aspose.Pdf.Image image = new Aspose.Pdf.Image(section);
//Add image object into the Paragraphs collection of
the section
section.Paragraphs.Add(image);
//Set the stream of pdf file
image.ImageInfo.ImageStream = fs;
//Save the document
objPDF.Save(@"C:\pdfcomplianttest.pdf");
fs.Close ();
Result:
Error: Parameter is not valid
2)PDF Document page to
Image(bmp,jpeg):
Converting
Pdf page to image(bmp,jpeg) for that we have used below method, which not
working for all the pdf files,It gives blank page or symbols or images .
It does not extracting
text.
byte [] yFullImage = null;
Aspose.Pdf.Kit.License lic = new Aspose.Pdf.Kit.License();
lic.SetLicense("Aspose.Total.lic");
//Create File Editor object
PdfFileEditor pdfEditor = new PdfFileEditor();
//Create file pdf
stream object
using (FileStream
inputStream = new FileStream(C:\PDFDocument.pdf", FileMode.Open))
{
using (MemoryStream
msOutStream = new MemoryStream())
{
//Extract Pdf page from pdf file and assign to
MemoryStream Object
bool bsuccess = pdfEditor.Extract(inputStream,
1, 1, msOutStream);
// Create converter object for converting pdf page to
jpeg
PdfConverter pdfConverter = new PdfConverter();
pdfConverter.BindPdf(msOutStream);
pdfConverter.DoConvert();
if(pdfConverter.HasNextImage())
{
using (MemoryStream
msOutPutImage = new MemoryStream())
{
pdfConverter.GetNextImage(msOutPutImage,System.Drawing.Imaging.ImageFormat.Jpeg);
//Memory stream converting byte array
yFullImage = msOutPutImage.ToArray();
msOutStream.Close();
}
}
pdfConverter.Close();
}
}
Result: white page/ some symbols/some images ……… Totally fail to
extracting text.