PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filename

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
jakobstill
User
Posts: 15
Joined: Thu Feb 28, 2013 1:12 pm

PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filename

Post by jakobstill »

Hi,

I'm having trouble with the pdfSaver adding "Microsoft Office InfoPath - " in front of all filenames when printing .xml-files to pdf.
In our office we regularly print xmls in bulk (up to 300 files at a time) using a inhouse script for the job. Until recently, the output has always been "filename.xml" -> "filename.pdf".
But now, without any updates or other changes to the computers or the software involved (to my knowledge) xchange is adding this prefix, even though only the "%[Docname]" macro is being used.
(Output being "filename.xml" -> "Microsoft Office InfoPath - filename.pdf)
This problem persists over all our computers in the office, and unfortunately the result causes our printing script to crash.

I have been reading your guide on titrules.js, and while I'm cautiously confident the solution is to be found there, I am not very knowledgeable in Java, I haven't been able to fix this issue myself.

We are running winXP, MS InfoPath 2007 and PDF-XChange 4.0 build 195

Also if it gives any clues to the problem, the original xml filenames are pretty long (eg. "A112_10 Name Describing The Test Form P-11045.xml") which before this error were reproduced correctly,
but now they are also cut short (eg. "Microsoft Office InfoPath - A112_10 Name Describing The Test Fo.pdf")

I am grateful for any help in this matter!
Best regards,
Jakob Still
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17823
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by Tracker Supp-Stefan »

Hello Jakob,

Has there been an update to Office 2007 recently?
We do not have control over what the printing application sends to us as a filename - and will take and use whatever it passes to the printing driver. From the description it seems like InfoPath has changed the way they send information at print time.

Or have you changed the titrules.js file provided with our printing drivers?

As to resolve the issue with trimming filenames - try changing the macro from %[Docname] to %[Docname].pdf

Best,
Stefan
jakobstill
User
Posts: 15
Joined: Thu Feb 28, 2013 1:12 pm

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by jakobstill »

Hello, and thanks for your answer.

I am not aware of any Office update, but it is of course possible. We have background company updates all the time that we might not know of. (I work for a rather large company)
I already tried %[docname].pdf, but it doesn't resolve the problem. Actually it doesn't change the output at all.

The other MS Office programs do not add the prefix; I just tried printing with the same exact settings from Word, Excel, etc. and the output filenames are all correct. (No "Microsoft Office Word" in front) So the problem seems to only be with InfoPath. Can I include InfoPath in titrules.js in some way to make it behave like the other Office apps?

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

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by Tracker Supp-Stefan »

Hello Jakob,

Yes certainly - you can edit the titrules.js file, and by looking at what you've provided earlier as a sample output file name - it seems like infopath places it's name and then " - " (space, slash,space) before the actual file name which is the same formatting as what Word and PowerPoint are using.

So you will need to just add a new line containing this text:

Code: Select all

case "INFOPATH.EXE":
in between these two lines in the file:

Code: Select all

case "WINWORD.EXE":		// MS Word
case "POWERPNT.EXE":
To get as a final result this:

Code: Select all

...
case "WINWORD.EXE":		// MS Word
case "INFOPATH.EXE":
case "POWERPNT.EXE":
...
And the file names should now be the way you want them.

Best,
Stefan
jakobstill
User
Posts: 15
Joined: Thu Feb 28, 2013 1:12 pm

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by jakobstill »

Hi,

I already tried that, and it didn't work.

My titrules.js looks like this now:

Code: Select all

function getDocumentName()
{
	var jobName = event.rawDocumentName;
	var docName = "";
	var pafn = event.appName.toUpperCase();
	switch (pafn)
	{
	case "NOTEPAD.EXE":		// Windows notepad
		docName = like_NOTEPAD(jobName);
		break;
	case "WINWORD.EXE":		// MS Word
	case "POWERPNT.EXE":
		docName = like_WINWORD(jobName);
		break;
	case "IEXPLORE.EXE":	// MS Internet Explorer
		docName = like_IEXPLORE(jobName);
		break;
	case "VISIO.EXE":
		docName = like_VISIO(jobName);
		break;
	case "WINHLP32.EXE":
		docName = like_WINHLP32(jobName);
		break;
	case "HH.EXE":
		docName = like_HH(jobName);
		break;
	case "ACAD.EXE":
	case "ACADLT.EXE":
		docName = like_ACad(jobName);
		break;
	case "123W.EXE":
		docName = like_WINWORD(jobName);
		break;
	case "INFOPATH.EXE":
		jobName = jobName.replace("Microsoft Office InfoPath - ", "");
		docName = like_WINWORD(jobName);
		break;
	default:				// Any other application
		if (jobName == "")
			jobName = event.appName;
		docName = like_DefaultApp(jobName);
	}
	return eliminateBadChars(docName);
}
As you can see, I tried my own little hack which didn't work. Actually I haven't observed any effect whatsoever on the filename output, despite any changes to titrules.js.

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

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by Tracker Supp-Stefan »

Hi Jakob,

Please try the attached titrules.js.
When I tried to print from Infopath using it I got the correctly trimmed file name.

Best,
Stefan
Attachments
Desktop.zip
(123.21 KiB) Downloaded 158 times
jakobstill
User
Posts: 15
Joined: Thu Feb 28, 2013 1:12 pm

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by jakobstill »

Hi Stefan,

Unfortunately the fix didn't work. I restarted the computer as well, to ensure that all functions would be run fresh and not be cached or anything, but still no change.
I'm starting to think that titrules.js might not be the culprit at all. I'm gonna try and hear with our IM-department to see if any updates have been applied recently that could have caused this error.

Thank you immensly for your help this far! I'll report back when I know more...

Best regards,
Jakob
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17823
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by Tracker Supp-Stefan »

Hi Jakob,

Please make sure that there's only one titrules.js file and that you are printing to the latest build of our printing drivers.
Before I modified my titrules - i was getting "Microsoft Office InfoPath - filename.pdf" as the default suggestion in the "Save As" dialogue box, but after editing it - it's working.

Please make sure to use my file as the custom modifications you've made are not the proper way to handle that string and trim the unwanted part. Let the "like_MSWORD" method do it all and just tell in titrules.js that INFOPATH.EXE is using the same formatting.

Best,
Stefan
jakobstill
User
Posts: 15
Joined: Thu Feb 28, 2013 1:12 pm

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by jakobstill »

Yes, I replaced my old titrules.js with the one I got from you, so there should be no trace of my mods.
How do I ensure that the latest build is being used?

Also, I might not have mentioned that I also have unchecked the "Show Save as.. Dialog", so that our printing script can work unhindered.
Settings are as follows:

Path: C:\Temp\pdfs\printed
File Name: %[DocName]
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17823
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by Tracker Supp-Stefan »

Hi Jakob,

Open one PDF in our Viewer and go to File -> Document properties. There you should see the build number of the driver that created this file.

Is the script running under the same user account as the one where you are replacing the titrules.js file or elsewhere?

Best,
Stefan
Tracker
jakobstill
User
Posts: 15
Joined: Thu Feb 28, 2013 1:12 pm

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by jakobstill »

PDF Producer: PDF-XChange 4.0.195.0 (Win XP Pro SP3 (Build 2600))
Application:
PDF Version 1.4
etc...

Do you mean our own "toolbox" printing script, or? Anyway, it should be, and also this problem has persisted on several computers, all with slightly different user statuses and rights.
(I just tested your titrules.js on on my bosses cpu, which should have all permissions. It didn't work.)
The machine I'm working on is logged in only locally, not to our company network, but that shouldn't make any difference either...
Also I have now been manually printing one form only (ctrl+p) and not been using our print script. (it basicly does the same thing, it's just a simple automation: open->print->close->open next etc.)

I'm gonna try and break my titrules.js to see if I can reproduce the error in the other Office apps, and see what happens...

BR,
Jakob
jakobstill
User
Posts: 15
Joined: Thu Feb 28, 2013 1:12 pm

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by jakobstill »

It actually worked! Breaking it, I mean :)
This is really interesting:

I commented out the entire swith (pafn){...} and printed a word file, which resulted in the error happening ("Microsoft Office Word - filename.pdf")
Then I started adding rows, and I thought that un-commenting (re-including)

Code: Select all

case "WINWORD.EXE:" 
would do it, but not until I un-commented

Code: Select all

case "POWERPNT.EXE":
   docName = like_WINWORD(jobName);
   break;
did Word print with correct filename ("filename.pdf")

For instance,

Code: Select all

case "NOTEPAD.EXE":
   docName = like_NOTEPAD(jobName);
   break;
is still commented out, but prints correctly anyway...

Yet InfoPath refuses...
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17823
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by Tracker Supp-Stefan »

Hi Jacob,

It seems like you are using 195 of our products which is rather old. Can you please try updating our printing drivers to the current latest:
https://www.pdf-xchange.com/product/downloads
And try once again?

As for commenting/uncommenting - if either of the two cases is true (the printing app is winword.exe or powerpnt.exe) you need to execute the code on the two lines below case "POWERPNT.EXE": - and when you had that commented - word name formatting will also not work.

Best,
Stefan
jakobstill
User
Posts: 15
Joined: Thu Feb 28, 2013 1:12 pm

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by jakobstill »

Ok, so I'll try and get PDF-XChange updated (won't be easy with the rediculous IT-security around here) and see what happens...

thanks again!

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

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by Tracker Supp-Stefan »

Glad to help Jakob,

Let us know how it goes and if our further assistance is needed after the update.

Cheers,
Stefan
jakobstill
User
Posts: 15
Joined: Thu Feb 28, 2013 1:12 pm

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by jakobstill »

Hello again!

New week and new challenges.

I installed PDF-XChange 2012 V5.0 build 269 on one computer and tried printing. Unfortunately, the problem persists, and InfoPath documents get the prefix exactly as before. This even after I included

Code: Select all

case "INFOPATH.EXE":
in titrules.js (Just for safe)

Other Office apps print with correct filename output...

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

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by Tracker Supp-Stefan »

Hi Jakob,

Are you including it as a separate "case:" entry or are you adding it between the Word and PowerPoint entries.
Please try with the file I provided and see if that will work.

Best,
Stefan
jakobstill
User
Posts: 15
Joined: Thu Feb 28, 2013 1:12 pm

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by jakobstill »

Hello Stefan,

Actually, your file and what I added was the same:

Code: Select all

case "WINWORD.EXE":		// MS Word
case "INFOPATH.EXE":
case "POWERPNT.EXE":
		docName = like_WINWORD(jobName);
		break;
And unfortunately, there's no change. It's funny how this is only a problem in InfoPath, though... :)

br,
Jakob
jakobstill
User
Posts: 15
Joined: Thu Feb 28, 2013 1:12 pm

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by jakobstill »

Ok, funny story, true story...

As I said, I installed the latest PDF-XChange, which didn't help. So now I have both 4.0 and 2012 (5.0) in my list of printers.
I called our own support to see if there's anything they can do about InfoPath, since the fault didn't seem to lie with PDF-XChange.

While the support guy was remoting to my cpu, I showed him how I print and get the wrong filename, both with 5.0 and then with 4.0.
Now - since this is on my own cpu and not the ones I was working on when we talked on friday - the titrules.js in my 4.0 folder accidentally still included the hack with

Code: Select all

case "INFOPATH.EXE":
	jobName = jobName.replace("Microsoft Office InfoPath - ", "");
	docName = like_WINWORD(jobName);
	break;
that wasn't supposed to work.

Except it did.
NOW the output was "My Original Filename Only It Has Been Cut Sho.pdf", ie. about 1/2 of the filename was cut off from the end, but the "Microsoft Office Infopath - " was finally gone.
As you probably gathered, this is still not correct, but it's a step forward! :)

Does this give you any hint towards what the problem could be?

br,
Jakob
Attachments
filenames.zip
(39.16 KiB) Downloaded 154 times
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17823
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by Tracker Supp-Stefan »

Hi Jakob,

That's really weird - as the modified titrules.js works at my end.
I see that you have another " - " (space, dash, space) in the .xml file name - but this should not matter.

I just ran some more tests, and could not reproduce the problem you are experiencing. I've not modified the like_Windowrd() method, and have only added, and commented the "case "INFOPATH.EXE": " line - and it works. Please see the attached images.

The file I was modifying is
C:\Program Files\Tracker Software\PDF-XChange 5\titrules.js
And is located in the same folder where the pdfSaver5.exe is located.
I've done this testing on a Win7 machine though - and with Office 2010. I presume it's time to check with one of my colleagues in the dev team who can test with Office 2007 and XP.

Best,
Stefan
Attachments
images.zip
(229.73 KiB) Downloaded 160 times
jakobstill
User
Posts: 15
Joined: Thu Feb 28, 2013 1:12 pm

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by jakobstill »

Yes, weird indeed.
Also, I couldn't reproduce the "success" of the titrules-hack on another cpu, which only makes it even more mystical.
Bottom line is that I have the same error on 4 machines that I have tried printing on, including my own with both 4.0 and 5.0 installed.
But my bosses machine seems to be printing with correct titles (as we speak), so when his printing is done, I'll take a look at his settings to see if I can find any discrepancies.
Unfortunately, I think windows 11 will be out before this company switches to win7, let alone InfoPath 2010, so I can't try this on a newer system.

Btw, is it some function in titrules that makes the filename shorter at the end? Like cutOffExtensions or NumberToFixedLenString?
I think these might be separate issues...

br J.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17823
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by Tracker Supp-Stefan »

Hi jakobstill,

We will now discuss your case internally and post back as soon as we have further advise.

Best,
Stefan
jakobstill
User
Posts: 15
Joined: Thu Feb 28, 2013 1:12 pm

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by jakobstill »

Ok,

We will try and change our printing script to disregard the incorrect filename, but still the cutoff at the end is still a problem in that case.

Again, I want to thank you for your help this far, and I look forward to hearing from you if you find a solution...

br, Jakob
jakobstill
User
Posts: 15
Joined: Thu Feb 28, 2013 1:12 pm

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by jakobstill »

Hi Stefan,

Today, all of a sudden, things are (kinda) working again. When I use our toolbox printing script, I still get the index out of bounds error for the first xml in the specified folder, but it recovers and continues to print the rest with no problem and - most importantly - the correct filename...
When I inspected the C# code of the toolbox a little closer, it turns out that XChange prints a pdf with the incorrect filename to one folder, then the script moves the file to another folder, and renames it according to the original asdf.xml, which it has fetched into a string earlier in the script, around when the file itself is opened...

Still the out of bounds error is something that hasn't happened in the past, but we are at least able to get past that and work again now :D
In the end, in other words, the problem never lied with XChange, but with our own script and probably some Office update...
(Other Office apps still print without adding the appname in front of the filename)

Once again, thank you so much for your help, you have been most accommodating and helpful!

Best Regards,
Jakob
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17823
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by Tracker Supp-Stefan »

Hi Jakob,

Glad to hear that a workaround has been found!
It was pleasure assisting you in this!

Cheers,
Stefan
cbran250
User
Posts: 5
Joined: Sat Mar 16, 2013 7:24 pm

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by cbran250 »

I am having a similar issue, but with Word 2007 itself. I uninstalled PDF X-Change Pro, downloaded the most recent version and installed it. The OS on my desktop is Win7 64 bit. Oddly, the problem does not occur when I print from Excel, but it does occur from PowerPoint

I have no such problems on my Win7 32 bit laptop (although it uses Office 2010).

I can see no difference in titrules.js between the two computers.

Very puzzling.
jakobstill
User
Posts: 15
Joined: Thu Feb 28, 2013 1:12 pm

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by jakobstill »

cbran, please read my very last post for details. When I resolved my problem, in the end it looks like titrules.js never played any role in the way InfoPath sent the filename information to the printer driver or in the way XChange handled it. I think the difference lies with Office 2007/2010, not PDF-XChange...
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17823
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by Tracker Supp-Stefan »

Thanks for posting Jakob,

I hope this advise is helpful to cbran250!

Cherrs,
Stefan
cbran250
User
Posts: 5
Joined: Sat Mar 16, 2013 7:24 pm

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by cbran250 »

jakobstill

After reading your last post, I do not see any way to fix the problem I have.

You speak of a toolbox printing script and of watching its behaviour. Forgive my ignorance, but this sounds like some kind of automated code for printing documents. I print from directly within Word by choosing "PDF-XChange Printer 2012" from the list of available printers.

In looking at the titrules.js, I do see mention of both Word and PowerPoint. PDFs printed from both of those programs include the name of the program at the beginning of the file name. On the other hand, when I print from Excel (which is not mentioned in titrules.js) the resulting file doe not include the program name. This is how things work in Win7 64, Office 2007 and PDF-XChange Printer 2012 (5.0 build 264).

I also looked more closely at how things work on my laptop (Win7 32 & Office 2010). In the pop-up status window which indicates printing progress, I noticed that the file name there includes the "Microsoft Word -" prefix, but that this prefix does not appear as part of the resulting PDF filename. I assume that this is indicates titrules.js is working as it should.

Still puzzled,

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

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by Tracker Supp-Stefan »

Hello CAB,

As you posted in Jakob's topic - we both assumed that your problem is related and you are also using some scripts to automate the printing process. After your latest post - it's obvious that wasn't the case.

As the first thing to try I would recommend you to download and install build 5.0.269 as this is the current latest and the problem you have was most likely fixed between build 264 (the one you use) and the current 269.
https://www.pdf-xchange.com/product/downloads

Best,
Stefan
cbran250
User
Posts: 5
Joined: Sat Mar 16, 2013 7:24 pm

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by cbran250 »

Yes, it does appear that I have slightly different problem. Before posting, I had downloaded the most recent (at that time). In fact, I had uninstalled the previous version, before installing that one.

Today I downloaded the most recent, and installed it right over the current edition. No changes, even after a reboot.

As mentioned in a previous post, the odd thing is that Excel prints as expected (without the program name) even though Excel has no entry in the titrules.js; while Word & PowerPoint (which do have entries) retain the file name.

CAB

I plan to do another removal and reinstall.
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by John - Tracker Supp »

OK - please advise if we can help further.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
cbran250
User
Posts: 5
Joined: Sat Mar 16, 2013 7:24 pm

Re: PDF-XChange 4.0 b195 adds "MS Office InfoPath" to filena

Post by cbran250 »

I uninstalled PDF-XChange Pro and rebooted. I then run three different tools to clean the registry and manually deleted all Tracker program remnants that I found, including the printer driver. After that I rebooted again. I was not sure of what else I could do to clean out any remaining traces.

Then I downloaded the most recent version of PDF-XChange Pro and used the full installation option. Rebooted again as prompted, after the installation. Ran Live Update, just to be sure everything was up to date. (Live update downloaded the help manual, but nothing else.)

Opened a file in Word 2007 and tried to print it. No joy. "Microsoft Word -" is still being prefixed to the original file name.

Opened an Excel file and tried to print it. Nothing was appended to the original file name. For Excel, it behaved exactly as it should.

I am at a loss of how to correct this.

Another interesting sidelight: If I use the PDF-XChange add-in from within Word itself, the PDF does not include the program name. It seems that going through the printer selection route does not use the proper filename parsing routine for Word, but the add-in does use it.

CAB
Post Reply