New User Questions

If you are a C/C++/C# developer and have any questions about using our products from your application here is the place to post them.
Post Reply
Jim Vollmer
Posts: 13
Joined: Tue Feb 22 2005
Location: California

New User Questions

Post by Jim Vollmer »

I just got the latest evaluation copy of PDF Converter version 2.50.
I am using the DLL interface to create a wrapper class in C++.
After reading the documentation and examining the files I downloaded,
I have a number of questions:

1) The evaluation install included a cdintf.dll (1,613,824 bytes).
cdintf250.zip contains cdintf250.dll (1,609,728 bytes).
The documentation saids to make a copy of cdintf.dll as cdintf250.dll.
They are different in size.
So which one should be used?

2) SetFileNameOptions has a number of options.
Most of them are in CDIntf250.h.
The following are missing ConfirmOverwrite, AppendExisting, AddDateTime, AddIdNumber, and AutoImageCompression. Why?

3) SetFileNameOptions allows selecting encryption and/or encryption128.
But, how are the passwords and flags passed to the library, so that they can be added to the PDF file while it is being created.

4) When should SimPostscript be enabled or disabled?

5) How do I set a digital signature?

6) CDICreateDC returns an HDC.
How does the library suggest it be released?

7) Where is a comprehensive description of the different flags.

Thank you
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Please find here the reply to your questions:

1) CDIntf250.zip contains CDIntf250.dll and the corresponding .h and .lib files. It could be that the version of CDIntf provided with the demo is a little bit newer than the one in CDIntf250.zip, so you need to copy CDintf.dll you got with the evaluation to your system directory and rename it as CDIntf205.dll.

Please note that if you installed the PDF Converter using our Install wizard CDIntf would have been already copied to your system directory and renamed.

2) AutoImageCompression is equal to Hex 80000000, it should be included in CDintf250.h, Concerning the other options you mentioned, they may not be included on purpose because these file saving options can not be used all togethter and one of them should be used only. If you wish to use any of them please feel free to add its declaration to your .h file.
I will however double check this with our developers and add any missing declaration that is supposed to be there.

3) If you wish to encrypt a pdf file while generating it by adding Encrypt or Encrypt128 to FileNameOptions you need to call the following functions to set the owner and user passwords and the Encrypt options:
SetOwnerPassword
SetUserPassword
SetOptions
Otherwise you can call EncryptPDFDocuemnt() or EncryptPDFDocument128 to encrypt the document after it is generated.

4) SimPostScritp (Simulate Postscript) should mainly be enabled when printing Powerpoint, Visio and Word documents having graphics. This depends however on the Operating system and Office version you have.
By example, for Powerpoint you need to enable SimPostScript under OS 2000, XP, and 2003, for Word you need to enable it under OS XP an 2003. SimPostSript influences the graphics output in the pdf file.

5) You can set Digital signature using the ActiveX interface of CDintf or using the following function of the DLL:
int WINAPI DocDigitalSignatureA(EXTDOCHANDLE edhDocument, LPCSTR SignedBy, LPCSTR Reason, LPCSTR ImageFile, LPCSTR Location, long PageNumber, long HorzPos, long VertPos, long Width, long Height, long Flags)

6) This is a windows DC you can use the DeleteDC Windows API to delete it.

7) I am not sure which flags you mean but you will find a complete documentation in our Developers' manual "Common Driver Interface you received with the driver.

Hope this helps.
Jim Vollmer
Posts: 13
Joined: Tue Feb 22 2005
Location: California

Post by Jim Vollmer »

Dear Joan,

On question #4 above I need a better explaination.

This is a developer's area in the forum.
Your answer was directed at an "application user" not developer.

My my program will generate output which will be used to create a PDF file. My program has nothing to do with MS Products other than Windows and MSVC.

So the question rephrased is "How do I know whether to enable SimPostscript for my application and what to recommend to my users and why?"

What criteria do I use?
What dependencies on the Operating System are there?
What dependencies on the output printer?
What dependencies on the type of output (text vs graphics)?
How does it influence the graphic output of the pdf file?

Thank you
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

You should enable postscript if you are drawing images with ROP operations that uses the background (the destination). i.e if you are drawing images with transparent background for instance.

"Dependencies on OS": There are no dependencies on the OS if you are using the gdi to print, not an office application.
"Dependencies on output printer": I didn't really get this, there are no output printers.
"Dependencies on output type" you need to enable postscript when printing transparent images.

Some GDI calls cannot be handled perfectly on virtual printers, since the destination surface cannot be read all the time. A ROP operation XORing with the destination cannot be handled perfectly for example. When postscript is enabled, we handle the postscript generated by that call, which does not read from the destination surface (the pdf file).

Hope this helps.
Jim Vollmer
Posts: 13
Joined: Tue Feb 22 2005
Location: California

Post by Jim Vollmer »

Thank you Joan,

1) A followup to question #2 above.
I called SetFileNameOptions ( NoPrompt + UseFileName + ConfirmOverwrite ) twice with the same DefaultFileName. It seems that ConfirmOverwrite does nothing. The new file just overwrites the old one.
Is the the expected behavior for the evaluation developer copy?

2) I called SetFileNameOptions without NoPrompt and got -30 activation error. Is the the expected behavior for the evaluation developer copy?

Thank you
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello Jim,

1) If you are using Hexadecimal values, please try to replace them by the corresponding Decimal values. You can call:
FileNameOptions (1 + 2 + 4096)

2) Using the Developer version of the PDF Converter you need to call NoPrompt or you will get an error because the Developer version doesn't have a user interface.

Hope this helps.
Jim Vollmer
Posts: 13
Joined: Tue Feb 22 2005
Location: California

Post by Jim Vollmer »

Dear Joan,

I do not understand your reply.
When using a compiled language, there is no difference between using the decimal or hexidecimal representation of a value. Your comment for me to use the decimal encoding 4096 instead of the hexadecimal 0x1000 for ConfirmOverwrite makes no sense.

The following 3 examples should do the same thing.
If they do not, then please explain the difference.

1)
SetFileNameOptions (1 + 2 + 4096)

2)
#define NoPrint 0x00000001
#define UseFileName 0x00000002
#define ConfirmOverwrite 0x00001000
SetFileNameOptions ( NoPrompt + UseFileName + ConfirmOverwrite )

3)
#define NoPrint 1
#define UseFileName 2
#define ConfirmOverwrite 4096
SetFileNameOptions ( NoPrompt + UseFileName + ConfirmOverwrite )

Obviously #2 and #3 are better documented.

By the way, I did change the 0x1000 to 4096 and got the same result!

So guess that I need to repeat my question.
"It seems that ConfirmOverwrite does nothing.
The new file just overwrites the old one.
Is this the expected behavior for the evaluation developer copy?"

Or because ConfirmOverwrite is a "user interface" operation it is not supported? If this is the case, this should be clearly documented.

In addition, the documentation should have a clear comment stating that NoPrompt must be set when outside developers are using the Developer version of the PDF Converter, otherwise the conversion operation will fail.

It seems that internal developers at Amyuni use the same documentation as outside developers. Because of this, it would be nice if there were comments about things which do not work or are unsupported in one environment or the other. For example, there should be a note that NoPrompt must be set by outside developers.

I will now get off my soapbox.

Thank you
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Yes, you are right about Hexadecimal and Decimal values.

The developer version of the PDF Converter will not display a confirmation dialog-box to the end-user. This is done by design so that the developer has full control over the conversion process. It is up to the calling application to check if the file exists and define the behaviour when it exists.

Concerning our Developers' documentation, this is not the same documentation for internal and external documentation, I will check with our Technical Writer about the note concerning NoPrompt and ConfirmOverwrite.

Best Regards.
kschmidt
Posts: 13
Joined: Thu Feb 02 2006

Post by kschmidt »

If the NoPrompt flag is not turned on (licensed version, 2.50g), the dev version will pop up a custom file save dialog for the user to set the file name and location the printer will save to. You say the converter will not display a confirmation dialog to the end user so we have complete control, but how is prompting them for overwrite confirmation any different than prompting them for a file name?

The COpenFileDialog has a OFN_OVERWRITEPROMPT flag that can be set so the system handles it. From a consistency standpoint I would expect the system to be handling this anyway, so even if it was a design decision before to eliminate this functionality from the driver, can you reconsider putting it back in? It doesn't take away any control from the devloper to have the option exist.

FYI, turning on the ConfirmOverwite flag on in the converter 2.50g prevents the driver from working at all. You get a device not ready message box before any event is sent to the app.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Are you using the Developer or End User version of the PDF Converter?

If you have the Developer version you will need to add NoPrompt to FileNameOptions other wise the driver will not work, you will not get the save as dialog box.

If you don't want to get a confirmation when the file exists you just don't need to add 'confirm before overwrite'. I don't believe that the 'device is not ready' message is a bug or so:
Using the Developer version, printing is enabled for a limited amount of time, so if you are using 'confirm before overwrite' and the users is taking some time to click on the 'yes' or 'no' button than during that time the printer is disabled.

It is advisable not to use 'confirm before overwrite with the developer version, you can either omit it if you wish to overwrite existing documents or use the 'Add ID' to the file name if you want to create a new file when one having the same name already exists.

Hope this helps, if you need more information please contact support@amyuni.com
kschmidt
Posts: 13
Joined: Thu Feb 02 2006

Post by kschmidt »

I'm using the developer version of the pdf converter.

You can ignore the FYI about the message box. I reset my machine and that went away. Have to love issues like that.

What I wanted to do with the converter was to have your file dialog prompt the user for confirmation if the file existed. In your documentation, as Jim pointed out, you have a FileNameOptions flag (ConfirmOverwrite 0x1000) that should do exactly what I wanted it to do. The problem here is that it does not do anything when it is used. Since all of this has been stated before, I don't understand your comments about not using the flag if I don't want the confirmation dialog.

The flag not working should probably be submitted to the developers as a bug.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

This is not a bug, this is a by design issue.

ConfirmOverwrite works as expected if you have the End User version of the driver. It doesn't work only if you have the Developer and this is because using the Developer version the developer decides about how the PDF file should be named and not the end user. Also using the Developer version doesn't generate any message boxes so it can be used without any user interface.

I will send your suggestion to our developers however and our project manager will decide on whether to make CofirmOverwrite enabled in the Developer version.

Thanks.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

I get the reply of our Project Manager, it was as i expected a 'by design' issue.

Here is the reply of the Converter Project Manager:

"We cannot implement this in a developer version since all User interaction should be implemented by the developer.
Some developer version run on servers and sometimes without an interactive desktop, we cannot popup a prompt on a server whenever a web user tries to overwrite a file. If the client needs user interaction, he can implement this himself."

Hope this helps.
Post Reply