Long filename

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
AppliedSystems
Posts: 1
Joined: Wed Oct 08 2014

Long filename

Post by AppliedSystems »

I am using CDIntfEx to print documents and setting FileNameOptions with (NoPrompt + EmbedFonts + BroadcastMessages + MultilingualSupport + UniqFileName) before calling EnablePrinter on it. The problem I am running into is if the filename is very long (such as 240+ characters), the pdf is never written. The EndDocPost event is raised, but the file (GetGeneratedFileName) does not exist (presumably Windows can't write the file). I've tried specifying UseFileName along setting the DefaultFileName, but this also affects all the documents that wouldn't need their name changed. I tried setting it during the StartDocPre event, but it won't fire when the file's too long. I've tried setting it during the StartDocPost, but at that point, it's too late.

Since you guys have the DefaultDirectory, is it possible to truncate the filename such that it isn't too long to fit in windows? Is there anything else we can try?
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Re: Long filename

Post by Jose »

Hello,

I believe this is a windows limitation.

In the Windows API the maximum length for a path is MAX_PATH, which is defined as 260 characters.
https://msdn.microsoft.com/en-us/librar ... px#maxpath

Thanks
Get PDF Suite, the expert .NET developer toolkit for PDF conversion, creation and editing - www.amyuni.com/pdfsuite
Post Reply