Bug, when filename contains parenthesis

This Forum is for the use of End Users requiring help and assistance for Tracker Software's PDF-XChange Printer Drivers only - Please do not post requests for older versions of PDF-XChange or the PDF-Tools/OFFice2PDF applications here

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Post Reply
maukia
User
Posts: 4
Joined: Wed Apr 03, 2013 8:40 am

Bug, when filename contains parenthesis

Post by maukia »

I have to convert files like:
ZBPD_1112857.4-8_CD_(A201)_b_Z_0562_1v1.doc
to PDF. I allready found a KB article for the problem with dots, but there is still an issue,
all parenthesis are converted to underscore:
ZBPD_1112857.4-8_CD__A201__b_Z_0562_1v1.pdf

This seems to be an undocumented feature, in both PDF-XChange 4 and 5.

Any work-a-rounds/bugfixes?

Yours
Matti Aukia
Siemens Switzerland
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17933
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Bug, when filename contains parenthesis

Post by Tracker Supp-Stefan »

Hello Matti Aukia,

And welcome to our forums!

Which is the version of MS Office installed? As our drivers won't normally change the file name as passed from the printing application other than to remove the "MS Word/Excel/etc. - " part of it using the titrules.js conditions. So it seems to me that it might be word that is converting the brackets to underscores before sending the filename to our printing drivers.

Best,
Stefan
maukia
User
Posts: 4
Joined: Wed Apr 03, 2013 8:40 am

Re: Bug, when filename contains parenthesis

Post by maukia »

Office is the 2003-Version.

But in the javascript-file "titrules.js" the function:
function eliminateBadChars(s)
{
// var r = /[\/\\<>:"\|\?\*]/g;
// return s.replace(r, "_");
return s;
}

is allready shortcut, I guess (?) that this could have been included in your application, why should it otherwise been commented.
Just like the bug/feature with multiple dots in filename, the javascript-function alone wouldn't behave that way...

I'm using the Office2PDF.exe/OFFice2PDF5.exe, and you can only convert files allready in file-system, so the file-names are free of unallowed characters, thus there is no need to fix them...

Matti
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17933
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Bug, when filename contains parenthesis

Post by Tracker Supp-Stefan »

Thanks for the additional details Matti,

I've passed this to the appropriate developer and will post back here when I have any further news.

Best,
Stefan
maukia
User
Posts: 4
Joined: Wed Apr 03, 2013 8:40 am

Re: Bug, when filename contains parenthesis

Post by maukia »

> it might be word that is converting the brackets to underscores

In order to check, if Word would give a false filename to PDF-XChange, I added two lines of code in the default titrules.js:

function eliminateBadChars(s)
{
s.replace("__", "_("); // first occurence of double underscores fixed back to original "_("
s.replace("__", ")_"); // second occurence of double underscores fixed back to original ")_"
// var r = /[\/\\<>:"\|\?\*]/g;
// return s.replace(r, "_");
return s;
}

And no change in behaviour. Either the titrules.js is not invoked at all or the application makes the changes after its invocation...

Good Hunting
Matti
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17933
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Bug, when filename contains parenthesis

Post by Tracker Supp-Stefan »

Hi Matti,

I've spoken with a few of my colleagues and we believe that it's Word that replaces the bracket with underscore when sending the file effectively for "printing", but I will also check with the expert for Office2PDF - and we will reply back with more details a bit later.

Best,
Stefan

P.S. After discussing this further it seems like a problem on our side indeed and I've created a ticket in our internal system:
#1809: Drivers V5: Issue with filenames containing parenthesis
That will allow us to track and resolve this.
maukia
User
Posts: 4
Joined: Wed Apr 03, 2013 8:40 am

Re: Bug, when filename contains parenthesis

Post by maukia »

Hi,
I managed to get a work-a-round with "titrules.js".
As a Java-programmer I had used the replace as a method instead of a function and omitting the return-value...

function eliminateBadChars(s)
{
// var r = /[\/\\<>:"\|\?\*]/g;
// return s.replace(r, "_");
var rs = s.replace("__", "_("); // 1. occurence of double underscores fixed back to original "_("
return rs.replace("__", ")_"); // 2. occurence of double underscores fixed back to original ")_"
}

So my assumption, that titrules.js is not invoked was false.

> After discussing this further it seems like a problem on our side indeed
Good, that You're fixing it.

> #1809: Drivers V5:
Unfortunately our IT is reluctant to upgrade to V5. But I have my results for V4.

Good Hunting
Matti
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17933
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Bug, when filename contains parenthesis

Post by Tracker Supp-Stefan »

Hi Matti,

Glad that you found a workaround!

It might get fixed for V4 as well - but I am not making any promises there.

Cheers,
Stefan
Post Reply