473,406 Members | 2,620 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,406 software developers and data experts.

Getting the Distiller API to work.

101 100+
I'm looking to interface with distiller using adobe's API. This is the guide I'm using:
http://partners.adobe.com/public/dev...IReference.pdf

Now, I've had minimal experience using win32 api for visual c++. However, I can't really tell what the guide is referring to in certain things. It just assumes you know the environment (win32?, MFC?, ATL?) and where to insert the code examples.

All I really need is to get a working API call of any kind. If I can get even a message popup from the api, I've got somewhere to start.

Thanks for any help.

BTW, I've got visual studio 2005, distiller and the adobe SDK. When I open a new c++ project, I get:

Expand|Select|Wrap|Line Numbers
  1. #include "stdafx.h"
  2.  
  3.  
  4. int _tmain(int argc, _TCHAR* argv[])
  5. {
  6.     return 0;
  7. }
The code example they give me is:

Expand|Select|Wrap|Line Numbers
  1. DISTILLRECORD dr;/* from distctrl.h */
  2. COPYDATASTRUCT cds;
  3. BOOL ok;
  4. LRESULT rtn;
  5. WORD res=0;
  6. char msg[ 80];
  7. hinst = ShellExec( NULL, "acrodist.exe", strCmdArgs, NULL, SW_SHOW);
  8. if (res<32){
  9. sprintf(msg, "WinExec failed: error code = %d", res);
  10. return;
  11. }
  12. CWnd *hDistillerCWnd = FindWindow("Distiller", NULL);
  13. if (hDistillerCWnd != NULL)
  14. {
  15. strcpy(dr.outputFile, "c:\\ OUT.PDF");
  16. strcpy(dr.fileList, "C:\\ TEST.PS");
  17. dr.param = EQ_NO_SAVE_DIALOG;/* from distctrl.h */
  18. cds.dwData = DM_DISTILL;
  19. cds.cbData = sizeof(DISTILLRECORD);
  20. cds.lpData = (PVOID)&dr;
  21. ok = (BOOL)hDistillerCWnd->SendMessage(WM_COPYDATA,
  22. (WPARAM)m_hWnd, (LPARAM)&cds);
  23. if (ok)
  24. /* wake up Distiller */
  25. hDistillerCWnd->PostMessage(WM_TIMER, ID_TIMER, 0L);
  26. }
May 13 '08 #1
2 2752
oler1s
671 Expert 512MB
It just assumes you know the environment
Yes, of course. APIs do have to presume certain amounts of knowledge. The most basic is knowing how to use the language, and usually extends to knowing how to program for a specific OS.

I'm not sure what your question is though. If your issue is that you don't how to deal with Win32 or MFC code, then clearly the solution is you need to familiarize yourself with said APIs. There isn't a way around this requirement.
May 13 '08 #2
weaknessforcats
9,208 Expert Mod 8TB
That's a really crummy example you have there.

1) it uses the C library string functions - big no-no
2) it uses MFC which is obsolete and very poorly designed
3) it does not use any of the TCHAR mappings required by Microsoft even though the author knows about them because he is using _tmain()
Expand|Select|Wrap|Line Numbers
  1. TCHAR msg[ 80];
  2.  
  3. _tsprintf(msg, TEXT("WinExec failed: error code = %d"), res);
  4.  
4) is uses a stack array that can be overrun (msg[80]).
5) it does use any of the secure functions for string handling provided by Microsoft.
May 14 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: MC | last post by:
Hi, I'm developing an VB.NET app that converts TIFFs to PDFs using Office Imaging 2003 and Adobe Distiller 6.0 in the follwing way: 1. Using automation, I open the TIFF file with Office...
4
by: fniles | last post by:
How can I instantiate an Adobe Distiller object from ASP ? Thank you.
4
by: xzzy | last post by:
I have been tasked with changing the filename Adobe Distiller defaults to. My guess is I can't change it. Has anyone been able to use VBA to change that name? Thanks, John Bickmore...
5
by: Filips Benoit | last post by:
Dear All, How to check if Acrobat Distiller is running and how to start it before output? Filip
6
by: tommaso.gastaldi | last post by:
Hi I am creating a pdf by just printing on Acrobat Distiller. This is fine. I need to create a pdf which has a given prespecified name and I do not wish that Distiller prompts me for a name....
3
by: mzmishra | last post by:
Hi, I have one application in c# .net 1.1. I like to convert word to pdf using Adobe Distiller . Can any body help me get some code samples in C# for the same?
2
by: ncsthbell | last post by:
I am just not sure the most efficient way to handle this. I have never used Adobe other than to open a document and read it! I have had Adobe Pro 8 installed on my machine to accomodate this...
1
by: Raymond Chiu | last post by:
Dear all, I have vb.net program which export excel to pdf format. I am using acrobat distiller but find the problem in the below statement. dim ddt as new ACRODISTXLib.PdfDistiller...
1
by: ncsthbell | last post by:
I am looking for any help with calling 'Acrobat Distiller' using an API from within Access. I have searched on the Internet and it is so very confusing!! I have the product installed but am looking...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.