. (dot) in file name causes rest of file name to be truncated!  SOLVED

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
asocialis
User
Posts: 40
Joined: Mon Feb 11, 2019 12:29 am

. (dot) in file name causes rest of file name to be truncated!

Post by asocialis »

I printed wikipedia page containing dot in title, and so it should in file name.
But file name text was saved with only text up to that dot.
Example: https://en.wikipedia.org/wiki/Herbert_M._Shelton
was saved as "Herbert M.pdf", meaning in save dialog it only displayed "Herbert M".
While it is supposed to be "Herbert M. Shelton - Wikipedia.pdf" like it did for other articles not containing dot.
I used Firefox and last version of PDF-XChange Editor (it's printer).
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Re: . (dot) in file name causes rest of file name to be truncated!

Post by TrackerSupp-Daniel »

Hello asocialis,

This can be modified from the naming scheme in the printer. By default it will drop anything after the last period, as it expects a file extension there and seeing title.xml.pdf is downright confusing. To change this, open the printer preferences and navigate to the "Save" category and add .pdf to the "File name" field:
image.png
This should allow the text after the period to stay in place.
Let me know how it goes!
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
asocialis
User
Posts: 40
Joined: Mon Feb 11, 2019 12:29 am

Re: . (dot) in file name causes rest of file name to be truncated!

Post by asocialis »

I can't see save tab in the left in preferences. Are you talking about PDF X-Change Editor Plus 7.0 328.2? There is no Save tab. My tabs in preferences are (from top to bottom): Documents, General, Page Display, Page Text, Registration, Accessibility, Color Management, Commenting, Convert from PDF, Convert to PDF, Customize UI, Document Info Bar, File Associations, Forms, Full Screen, Identity, JavaScript, Languages, Launch Applications, Measurement, Multimedia 3D, Performance, Places, Plugins, Scanner Presets, Search Providers, Security, Send Mail, SharePoint, Signatures, Snapshot Tool, Speech, Tools, Update. My pdf printer is lite, and does not have almost any preferences (PDF-XChange Lite 7.0 328.2). Or am I supposed to install different product to be able to do that? Not pdfsaver that comes with pdf editor?
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Re: . (dot) in file name causes rest of file name to be truncated!

Post by TrackerSupp-Daniel »

Hello asocialis,

I was speaking about our printer drivers, not the Editor, and yes, even our Lite driver has these settings. When printing from any application, before you click print, select our printer from the list and open the "Printer preferences" (or "Printer properties"). From that menu you should see the Save category on the left:
image.png
I hope this helps!
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
asocialis
User
Posts: 40
Joined: Mon Feb 11, 2019 12:29 am

Re: . (dot) in file name causes rest of file name to be truncated!

Post by asocialis »

No, does not help. It is same as before, it does not even save as double pdf, but exactly same as before.
I tried also using .aaa instead of your suggestion .pdf, then it displays "Herbert M.aaa" in dialog box.
Any alternative? There are many wikipedia articles containing . in title. Fixing it manually for small number of files would not be problem, but for large number of files that would be inefficient and time wasting. :(
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Re: . (dot) in file name causes rest of file name to be truncated!

Post by TrackerSupp-Daniel »

Hello Asocialis,

I think I have found a solution for you, this is a bit of an extreme solution, but it should work in the meantime for you. After rigorous testing, I found that when printing from Wikipedia the original file name always ends with " - Wikipedia" so I turned that into a preliminary identifier in our title rules javascript file(titrules.js) for PDF-Xchange Lite for you. I tested this with the article you are using "Herbert A. simon" and the result was just right.

This will only change the handling in cases where " - Wikipedia" appears in the filename, otherwise the usual "." delimimter will be used.

To apply this, download and unzip the file I have attached to my post.
Then navigate to the install directory of our Lite printer (Default: C:\Program Files\Tracker Software\PDF-XChange Lite )
Finally, replace the existing titrules.js with the new one that you extracted from my file. (you will need to provide administrator permission to do this)

Now, close any open print dialogs, and then attempt printing a Wikipedia page to PDF again.

If you need to add additional arguments to this, you can open the titrules.js file in any text editor (I recommend notepad++) and edit the JS manually for the cutOffPath(s) function, on lines 45-48:
image.png
image.png (8.99 KiB) Viewed 7675 times
Attachments
titrules.zip
(1.18 KiB) Downloaded 160 times
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
asocialis
User
Posts: 40
Joined: Mon Feb 11, 2019 12:29 am

Re: . (dot) in file name causes rest of file name to be truncated!

Post by asocialis »

Thanks, that worked somewhat. But since I downloaded other wikipedia articles with " - Wikipedia" in file name, can I do it here too?
It's good that this can be edited by us, but I hope you will make more options in app in future versions.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Re: . (dot) in file name causes rest of file name to be truncated!  SOLVED

Post by TrackerSupp-Daniel »

Hello asocialis,

It may be possible, but the only way I could get it to work consistently was to completely remove (comment out) the cutOffPath function, by placing a /* before and */ after it. This results in a warning when printing as the function is called but cannot be found when printing. Of course this also has the side effect of making all file extensions remain in printed file names as well (.xml, .docx, etc).

Does that help?

Of course the Dev team is still working on this and thus we should see more improvements and options as time goes on.

Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
asocialis
User
Posts: 40
Joined: Mon Feb 11, 2019 12:29 am

Re: . (dot) in file name causes rest of file name to be truncated!

Post by asocialis »

Not a big deal. I can still do it all manually by watching out for wikipedia articles that contain . in filename.
Then renaming such files manually based on their title that is kept in saved pdf.
Or use that new js file and keep saving wikipedia pages without text " - wikipedia" because i prefer shorter file names and they are anyways kept in separate folder from other pdfs, like wikipedia/article, wikipedia/template, wikipedia/category, and i put rest of files that can't be printed like gif animations, videos, sound files in wikipedia/media. I'll just have then to rename the files i already downloaded to be without "- Wikipedia" in file name using total commander multi-rename. And I already use notepad++, and may learn experiment with that js file. It would be good to have more options for file names in future versions.
asocialis
User
Posts: 40
Joined: Mon Feb 11, 2019 12:29 am

Re: . (dot) in file name causes rest of file name to be truncated!

Post by asocialis »

And do not forget to also include other characters in page title just like Firefox does.
For example : (replace it with _ or space).
I like firefox and others browsers naming scheme.
Because wikipedia articles with names Article, Template:Article, and Category:Article all get saved as Article.
Currently I am using firefox's save as dialog to copy generated file name, then paste it into your dialog.
There are many other characters that should be considered. Not just dot.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17820
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: . (dot) in file name causes rest of file name to be truncated!

Post by Tracker Supp-Stefan »

Hello asocialis,

Some special characters that can not be used in file names, are normally handled by the scripts in that JS file. If the method is commented out as Cody suggests - other character manipulations will also suffer.

The solution might be to write your own custom title management scripts - but this will require RegExp knowledge.

Regards,
Stefan
Post Reply