I have used the Synactis product PDF-in-the-box in Delphi 2006 projects and also a free component they had called TPDFViewer, which allows you to embed a PDF viewer in your application.
I am porting one app to XE and - having found that trying to install the TPDFViewer I had in XE did some serious damage to my installation - I'm looking for a replacement.
I have installed XE-supported trial versions of their current offerings PDF-in-the-box 4.04 and All-in-the-box 4.04 but can't see any sign of the TPdfViewer component in either. Their website FAQ implies this functionality has been replaced by functions to start Adobe Reader.
So I want a (free would be nice, but not essential) PDF viewer for Delphi XE which doesn't just chain to Adobe Reader and allows user interaction or programmatic control over zoom, page number etc.
I tried several times to find a good PDF viewer. Most of them were fake components. The best way is to embed acrobat reader dll directly into your application and command it from there.
It was 8 years ago, so I do not remember the code that I used to do this. You import the acroXX.dll file directly into Delphi, it prepares a user component for you and then you install this component directly in to your Component palette.
The worst thing in this configuration is that you have to take care of the acrobat reader dll that is installed on your clients. Any update/upgrade of the reader may cause your application to fail.
Related
Here is the screenshot of the Adobe Encore program.
Here you can see the set of the darkish components.
Can such be bought, downloaded, etc? Are they made public from Adobe Cor.?
Thanks
The easiest way to achieve that look and feel is either:
To purchase a skin engine or component library that has skins enabled, if you must use an old version of Delphi prior to XE2.
But the preferred method is to just use the VCL skins library that comes in Delphi XE2, called VCL Styles. Unfortunately it has bugs, but so do all the other skin libraries. You can also achieve similar results in Delphi XE2 using the Firemonkey framework, which like whatever non-delphi technology is used in Adobe products, eschews native controls for a completely self-contained environment that can look any way you want it to.
If you want funky/pretty user interfaces, personally, I recommend you get Delphi XE2. If you insist on "try/buy/component" then I suggest you look into the Developer Express component suite, or one of the ones listed in this question such as VCLSkin.
Every Delphi 7 developer knows that if he compile a application on Delphi 7, the style will be as Windows 2000 applications, but there is any method to make this better as the application can have the default theme of the Windows version, as C++ and C# applications?
Try adding the TXPManifest component to the main form of your application. located in the Win32 Tab.
The TXPManifest component has no methods or properties. All it does is include the XPMan unit in your project. This in turn causes a certain resource file to be included in your project's executable file. The resource includes a manifest - a small piece of XML that contains information about the application you are writing as well as information concerning the version of the comctl32.dll to use.
Alternatively add your own manifest resource manually - which allows you to tap into the even newer Windows 7 features, if you can be bothered to fathom out the syntax. See this link for more info but ignore the bit about enabling runtime themes as this doesn't exist in D7 (I don't think).
I need to add TWAIN scanning to an Delphi application and am having trouble locating an off-the-shelf component to do so.
I downloaded TDelphiTwain but, when used in D2010 on Windows Vista, it does not appear to recognize any Twain sources on my system. I also tried the trial version of Twain Toolkit for Delphi from MCM which has the advantage of being currently updated (DelphiTwain's last update was 2004), but the Twain Toolkit will not even compile on my system (I think some of the DCUs are out of date).
Can anyone suggest a simple method of getting TWAIN scanning into my Delphi application?
UPDATE: Using vcldeveloper's update to DelphiTwain (see below) I was able to get this working. Also, I also discovered that Envision Image Library supports Twain scanning as well as assisting in handling multi-page TIFFs, and has been updated for compatibility with D2010.
Late Breaking UPDATE VCLDeveloper's code, below, works fine. However, I settled on Envision library which includes the ability to easily create multi-page TIFF files. I got the Envision scanning, including multi-page file handling, implemented in a few hours.
I changed DelphiTWAIN to work with Delphi 2009 and 2010. You can download the source code from here: http://www.kluug.net/delphitwain.php
Additional links are here:
http://torry.net/pages.php?id=507
and here: http://www.delphipraxis.net/1179589-post3.html
Another graphic library that also supports TWAIN scanning is ImageEn which also can save the scanned documents as PDF (as well as numerous graphical formats). That feature alone sold me on that product years ago.
I have imported Acrobat Reader using Components | Import Components. The AcroPdf_TLB unit is created in the Imports directory.
When I try to use the AcrobatReader component, as follows ...
AcroDoc := TAcroPDF.Create(nil);
... I get an 'Unspecified Error' exception (EOleSysError). Any ideas?
Thanks, Pieter.
If you are unhappy with the results you are getting there (I was), you might consider giving QuickPDF a try. The price is not unreasonable, they have lots of good PDF functions included and you can display a PDF accurately in a TImage control with a call to RenderPageToStream. One thing I discovered working with form fields is that I had to use their FlattenFormField before rendering to get the form field contents to be included in the rendered image.
Follow up:
I did not mention originally that QuickPDF also works for printing. For form fields, you have to do the same FlattenFormField routine, but the results look good with much less overhead than relying on Acrobat Reader.
We use the Adobe Reader plug-in and face this issue often. It particularly surfaces after a user performs a web-update on the Adobe Reader.
Try un-installing (via the Control Panel), then re-installing the latest Adobe Reader.
That invariably clears the issue for our users.
Put the component on a TForm, then it probably works.
The Acrobat ActiveX/COM object is notorious for not supporting interfaces of older versions properly. You get EOleSysErrors all over the place.
What I have personally done for a couple of clients, is load the PDF documents in a TWebBrowser.
TWebBrowser is a wrapper around the ActiveX/COM component that Internet explorer uses to display everything.
Adobe is pretty good in making that work with each Acrobat update, so the TWebBrowser then also works.
Note that this only makes sense for displaying the PDF document.
--jeroen
We successfully used the acrobat v6 reader component in our Delphi 7 app, but found that it really requires acrobat v6. Users today who install only acrobat v9 get an error when they use our app to view a pdf because the acrobat component is not backward compatible in this way.
So yes, you can do it, but there are probable issues going forward.
A third party tool is prob best...
I'm porting an application from Crystal Reports 8 to Crystal Reports XI in Delphi 5, using the RDC/ActiveX interface.
In Crystal Reports 8, I was able to bring up the crystal reports default report viewer window for a report like so:
RptInvoicing.Destination := 0; // To: window
RptInvoicing.Action := 1; // Execute
However, this does not fly with CR XI. Printing and exporting I've figured out to work like this:
crReport.PrintOut(True);
...
crReport.Export(True);
But I haven't been able to find anything relevant to show the default preview window. I've tried implementing my own using the report viewer component, but it has a lot of problems like locking up when resizing, freezing and crashes, so it's not a viable solution for a production app.
Even the official support forums weren't of help, I only got a nasty answer to go look at the manuals, which I've been through several times and can only refer to as bad. It's not every day you see such bad documentation for an enterprise product. I found nothing relevant to this in their manuals, so I'm led to think their own staff have no idea about this either.
So I'm hoping someone here could tell me if the default report viewer still exists in CR XI, and if it does, how to invoke it? If it doesn't, is using the report designer component really the only solution to create one?
I recently had the same problem, and described the solution here. I am using Delphi 2007, but since the code involves calls to an external ActiveX DLL, it should work for you too.
From their documentation:
Craxddrt.dll (Crystal Reports ActiveX
Designer Design and Runtime Library)
is a unified object model that
combines the runtime capabilities of
the Craxdrt.dll (Crystal Reports
ActiveX Designer Run Time Library)
with the design time capabilities of
the Craxddt.dll (Crystal Reports
ActiveX Designer Design Time Library).
Craxddrt.dll will replace Craxddt.dll
for versions 8.5 and up. Both the
Craxddrt.dll and the Craxdrt.dll
contain all the objects and associated
methods, properties, and events needed
for creating, opening, exporting,
saving, and printing a report at run
time. In addition, Craxddrt.dll is
either used with the RDC ActiveX
Designer when designing reports at
design time, or used with the
Embeddable Designer when designing
reports at run time. See “Embeddable
Crystal Reports Designer Control
Object Model” on page 343 for more
information.
Note: The RDC ActiveX
Designer is only available in
Microsoft Visual Basic.
Prior to
version 8.5, the Craxdrt.dll would be
distributed with an application. Now
the developer has a choice of two
automation servers to distribute.
Craxdrt.dll is backwards-compatible
with previous versions and contains
all the features introduced in this
version. Use the Craxdrt.dll for any
client-side application that does not
contain the Embeddable Designer, or
use it for any server-side
application. Craxddrt.dll is
apartment-model threaded, but is not
thread safe, and can only be used in a
client-side application. Although the
Craxddrt.dll is a fully functional
automation server for the RDC, and can
work in any client-side application,
it will increase the install size.
Therefore, it is recommended that you
only use Craxddrt.dll with the
Embeddable Crystal Reports Designer
Control.
I can't say anything about Delphi, but in VB we are using CRViewer ActiveX Control. Using it is straightforward - you put viewer control on form and assign RDC object to it. This is covered in CR help somewhere. (I can't look at code ATM to provide working exmples.)