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
Bug, when filename contains parenthesis
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
- Tracker Supp-Stefan
- Site Admin
- Posts: 17933
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Bug, when filename contains parenthesis
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
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
Re: Bug, when filename contains parenthesis
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
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
- Tracker Supp-Stefan
- Site Admin
- Posts: 17933
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Bug, when filename contains parenthesis
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
I've passed this to the appropriate developer and will post back here when I have any further news.
Best,
Stefan
Re: Bug, when filename contains parenthesis
> 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
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
- Tracker Supp-Stefan
- Site Admin
- Posts: 17933
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Bug, when filename contains parenthesis
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.
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.
Re: Bug, when filename contains parenthesis
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
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
- Tracker Supp-Stefan
- Site Admin
- Posts: 17933
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
- Contact:
Re: Bug, when filename contains parenthesis
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
Glad that you found a workaround!
It might get fixed for V4 as well - but I am not making any promises there.
Cheers,
Stefan