473,388 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

PDF preview in a c++ application

Hi

In my C++ application (no MFC) I have a dialog and like to show a PDF
preview in this dialog.

How can I do that?

Thanks
Hans
May 12 '06 #1
4 2659
You can launch Acrobat Reader as an external application, using
::ShellExecute("open", ...). Or you can embed the Acrobat Reader ActiveX
control in your application, but it has several bugs that make your life
quite difficult, and the functionality provided by the ActiveX control
is very thin (all can do little more than load a file and navigate to a
certain page).

The most comprehensive solution with the greatest degree of control is
by using the Adobe Acrobat API to write an Acrobat plugin. The way it
works is it renders the page for you on an HDC that you pass to the API.
You have to do inter-process communication between the Acrobat plugin
and your app. The drawback of this solution is that there's virtually no
documentation (other than the over thousand-page SDK reference from
Adobe), no newsgroups where you can expect help from other programmers,
and no sample applications that show you how to do it (and believe me,
it's enormously overcomplicated). In addition, the SDK is only free for
the full version of Acrobat. If you want to write a plugin for the free
Acrobat Reader, you have to pay over thousand dollars in license fees
(don't quite remember exactly how much).

Tom
Hans Stoessel wrote:
Hi

In my C++ application (no MFC) I have a dialog and like to show a PDF
preview in this dialog.

How can I do that?

Thanks
Hans

May 12 '06 #2
12 May 2006 16:57:07 +0200, Hans Stoessel <hs************@pm-medici.ch> wrote:
In my C++ application (no MFC) I have a dialog and like to show a PDF preview in this dialog.

How can I do that?


You can try the following link.
It's a free utility to convert any text file to PDF format.

It provides also: pdflib.dll pdflib.lib pdflib.h
This library is free for personal usage and
requires a license for commercial products.

http://www.codeproject.com/tools/Text2PDF.asp

__
JF Jolin
May 12 '06 #3
Hi

Thanks for the answer.

I should only open an existing PDF and should show it in a window (device
context; CDC). Maybe I can render the PDF into a bitmap and show the bitmap.

Is there a possibility to do that?

Thanks
Hans

"JF Jolin" <sp**@nospam.com> schrieb im Newsbeitrag
news:op**************@news.contact.net...
12 May 2006 16:57:07 +0200, Hans Stoessel <hs************@pm-medici.ch>
wrote:
In my C++ application (no MFC) I have a dialog and like to show a PDF
preview in this dialog.

How can I do that?


You can try the following link.
It's a free utility to convert any text file to PDF format.

It provides also: pdflib.dll pdflib.lib pdflib.h
This library is free for personal usage and
requires a license for commercial products.

http://www.codeproject.com/tools/Text2PDF.asp

__
JF Jolin

May 15 '06 #4
Hans Stoessel wrote:
I should only open an existing PDF and should show it in a window (device
context; CDC). Maybe I can render the PDF into a bitmap and show the bitmap.

Is there a possibility to do that?


Yes, using the Acrobat SDK. You have to write a plugin for Acrobat.
Since Acrobat is running in a separate process than your application,
you need to use inter-process communication between them to pass the
HDC. Note that you don't have to open an Acrobat window to do this. You
can render a PDF page right on an HDC. It takes a while to learn the
Acrobat SDK, it's enormously complicated, and if you do a google search
on any of the SDK functions, you'll usually get exactly 0 hits.

Then there's the DocuCom PDF Core Library, which is a 3rd party library
that mimics the Acrobat SDK functionality. The advantage of it is that
it doesn't require any Adobe product to be installed.

Then there's always GhostScript, which is able to rasterize a PDF file
(create a .bmp or .tif for you). However, it's always a bit behind the
latest Adobe technology, and I have several perfectly valid PDF files
that GhostScript can't handle very well. Also, it's only free for
personal and academic use, you can't distribute it with your commercial
product without obtaining a license.

Also, there are several print drivers out there that create a .tif file
out of anything printable. There's Black Ice and LeadTools, just to name
two. Then you can make Acrobat print to this virtual printer to
rasterize a PDF file.

Tom
May 15 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mike | last post by:
Sites using thumbnail preview for world wide web file navigation and searching. Below are list of sites that are either researching or providing thumbnail preview images for online web...
1
by: V.Boomessh | last post by:
Hai All I am developing a VB application in .NET Version Info as seen in Help --> About of Visual Studio.NE Microsoft Dev. Env 2003 V 7.1.308 Microsoft .NET framework 1.1 (V 1.1.4322...
1
by: sea | last post by:
I have Access 2002 and I am writing this application with a custom menu bar that has a print preview button -- the start up options hide the design window. The problem is that when an open form is...
2
by: Craig Scheets | last post by:
I have writting an application that prints fine, but I have to do a TranslateTransform on the graphics in the OnPagePrint event to get place output at exact X,Y (the application prints checks and...
5
by: Dave A | last post by:
I am writing an ASP.NET tool that will allow the client to create their own online froms. ie the client can add tect boxes, text, drop downs,etc with absolutely no technical skill what so ever....
2
by: Dean Slindee | last post by:
Anybody written code in VB.NET to: 1) show a print preview window of reports already written and stored in an Access 2002 database; or 2) execute the print of a report stored in an Access 2002...
0
by: Brad Pears | last post by:
I have a vb.net 2005 application where the user can select to preview an image. The users are CAD designers and typically have their default printer set to a plotter with a large paper size etc......
2
by: Brad Pears | last post by:
I have a vb.net 2005 application and am using the print preview screen. This screen has a printer icon on it that the user can use to print the document currently being viewed. It uses the default...
4
by: scubasteve | last post by:
I've developed a product pricing application for a client in AC2007. They enter all the data on the one main form, then click a button to open a printable report in Print Preview. My problem...
7
by: sandeepk84 | last post by:
Hi all... I have file upload option in my web application. I use Struts 2. I wanted to show a preview of the uploaded file to the user. The uploaded file can be of any type like...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.