Link to home
Start Free TrialLog in
Avatar of vu3lmg
vu3lmgFlag for United States of America

asked on

convert PDF page to Image using iTextSharp

I have an ASP.NET project.
Single page PDF file is stored in the database.  I have to display it as a sub report in crystal report.
I am using iTextSharp.

Please
*1 Explain me how to display PDF in crystal report as a subreport.
or
*2 Explain me how to use iTextSharp to convert that PDF into an image (I know how to display image in crystal report as subreport)
Avatar of Mike McCracken
Mike McCracken

You should be able to display the PDF directly

Create a new report
Unless you need data for something click OK on the data screen
Click INSERT --> OLE OBJECT
Choose Adobe Acrobat Document from the drop down
Navigate to the file
Select the file
Click OPEN
Insert where you want it
Size it to fit the page

mlmcc
Avatar of vu3lmg

ASKER

mlmcc
Since the report is generated dynamically.  The PDF is also different every time.
The report does not seem to refresh with new PDF content. It displays the content that was loaded when I inserted the OLE OBJECT.
How do I refresh the content after changing the underlaying PDF file ?
VU3LMG
Is the PDF named the same each time or are they creating a new PDF with a new name?

If it is a new PDF (name) each time then you can't do it.  Crystal only allows dynamic images.

If you just change the existing PDF then the report should update it on open or you may have to refresh the report.

mlmcc
Avatar of vu3lmg

ASKER

mlmcc
Yes the PDF is named the same each time.
Are you suggesting to user .RefreshReport() method ?
This PDF is contained in a subreport, how do I refresh a subreport ?
VU3LMG
The subreport should refresh when you refresh the main report.

SO long as the report is not saved with data, it should refresh on opening.

mlmcc
Avatar of vu3lmg

ASKER

Well,   the whole report seem to display the new data, except this sub report which points to the PDF.
VU3LMG
ASKER CERTIFIED SOLUTION
Avatar of vu3lmg
vu3lmg
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vu3lmg

ASKER

Could not find a solution to this problem.  
Decided to display that PDF as a seperate pop up then the report.
Will close the question