Windows 10: Microsoft Print to PDF silently fails creates 0kb if filename or path contains comma

Discus and support Microsoft Print to PDF silently fails creates 0kb if filename or path contains comma in Windows 10 Drivers and Hardware to solve the problem; Doesn't matter the original program you are printing from, if your filename or path contains a comma the Microsoft Print to PDF silently fails creating... Discussion in 'Windows 10 Drivers and Hardware' started by GreggEmery, May 5, 2020.

  1. Microsoft Print to PDF silently fails creates 0kb if filename or path contains comma


    Doesn't matter the original program you are printing from, if your filename or path contains a comma the Microsoft Print to PDF silently fails creating a 0kb corrupt file.Microsoft rep Lance Cai MSFT acknowledged this 6/29/16 on this post yet still doesn't appear to be fixed.


    Issue seen on multiple PC's & can be easily replicated per my guidance above. Machines tested had Win10 x64 v1607 and v1809


    Similar post where 250 people confirmed they have the same issue & 46 people said @Stan Gobien's response to not include comma helped them

    :)
     
    GreggEmery, May 5, 2020
    #1
  2. 3ICE Win User

    Bug in "Print to PDF" and "Print to XPS" in Windows 10? comma in filename results in zero-byte file

    I can. Commas are frequently used as parameter separators. Applications can incorrectly assume that the part before the comma is one path, and the part after it is another. Or it could think that the part after the comma contains optional command line options.

    Here is a plausible explanation: A badly coded substep in the print to pdf toolchain interprets the path with a comma in it as two separate paths and fails silently since neither can be found. The next tool in the chain then proceeds as if nothing has happened,
    ignoring or never receiving the error from the previous step/tool that failed. That's how we end up with this zero byte output.
     
    3ICE, May 5, 2020
    #2
  3. Anak Win User
    Occasionally "Microsoft print to pdf" creates empty files

    Hi,

    If the file name of the .pdf that is sent to the printer contains "special characters" i.e. \ / : * ? " < > | or a comma, the file sent to the printer will be 0 ir 1kb in size: Enable there are no comma in the file name you enter

    Filename | MS Docs

    • What do you do when you catch one of these 0/1kb files to allow it to print?
    • What PDF program do you use?
     
    Anak, May 5, 2020
    #3
  4. Microsoft Print to PDF silently fails creates 0kb if filename or path contains comma

    Programmatically set filename and path in Microsoft Print to PDF printer

    I have a C# / .net program that creates various documents. These documents should be stored in different locations and with different, clearly defined names.

    To do so, I use the System.Drawing.Printing.PrintDocument class in .net

    I select the "Microsoft Print to PDF" as printer with this statement:

    PrintDocument.PrinterSettings.PrinterName = "Microsoft Print to PDF";

    In doing so I'm able to print my document in a pdf file. The user gets a file select dialog. He can then specify in this dialog box the name of the pdf file and where to store it.

    As the amount of files is large and it is annoying and error-prone to find always the correct path and name, I would like to set already the correct path and filename in this dialog box programmatically.

    I already tested these attributes:

    PrintDocument.PrinterSettings.PrintFileName

    PrintDocument.DocumentName

    Writing the required path and filename to these attributes didn't help.

    Does anybody know, how to set the default values for path and filename for the "Microsoft Print to PDF" printer in C#?

    My environment:

    Windows 10

    Visual Studio 2010

    .net 4.5
     
    Matthias_70, May 5, 2020
    #4
Thema:

Microsoft Print to PDF silently fails creates 0kb if filename or path contains comma

Loading...
  1. Microsoft Print to PDF silently fails creates 0kb if filename or path contains comma - Similar Threads - Microsoft Print PDF

  2. Microsoft Print to PDF create 0kB

    in Windows 10 Gaming
    Microsoft Print to PDF create 0kB: In recent days, my computer has been having an error when using Microsoft Print to PDF to create a PDF file, the result is a 0kB file and cannot be opened. Please help....
  3. Microsoft Print to PDF create 0kB

    in Windows 10 Software and Apps
    Microsoft Print to PDF create 0kB: In recent days, my computer has been having an error when using Microsoft Print to PDF to create a PDF file, the result is a 0kB file and cannot be opened. Please help....
  4. Microsoft Print to PDF create 0kB

    in Windows 10 Drivers and Hardware
    Microsoft Print to PDF create 0kB: In recent days, my computer has been having an error when using Microsoft Print to PDF to create a PDF file, the result is a 0kB file and cannot be opened. Please help....
  5. Microsoft Print to PDF not populating the filename

    in Windows 10 Gaming
    Microsoft Print to PDF not populating the filename: I am unable to choose the destination or name the file. It just defaults to Microsoft print to PDF as name and saves on desktop. It overwrites any previous file....
  6. Microsoft Print to PDF not populating the filename

    in Windows 10 Gaming
    Microsoft Print to PDF not populating the filename: When I print to a PDF, it used to be that the filename was populated in the save dialog window so I didn't need to type it and the folder location was the last location I saved a PDF to. Now, the file name is "Blank" and I need to manually type something in. How do I get the...
  7. Microsoft Print to PDF not populating the filename

    in Windows 10 Software and Apps
    Microsoft Print to PDF not populating the filename: When I print to a PDF, it used to be that the filename was populated in the save dialog window so I didn't need to type it and the folder location was the last location I saved a PDF to. Now, the file name is "Blank" and I need to manually type something in. How do I get the...
  8. Microsoft Print to PDF tool create file 0kB

    in Windows 10 Gaming
    Microsoft Print to PDF tool create file 0kB: I use Microsoft Print to PDF but it create file 0kB and can't open. I have tried all the ways on this forum but it still doesn't work. Help./. https://answers.microsoft.com/en-us/windows/forum/all/microsoft-print-to-pdf-tool-create-file-0kb/c953c3b5-6e80-4f6d-a10a-d44f35701c51
  9. Microsoft Print to PDF tool create file 0kB

    in Windows 10 Software and Apps
    Microsoft Print to PDF tool create file 0kB: I use Microsoft Print to PDF but it create file 0kB and can't open. I have tried all the ways on this forum but it still doesn't work. Help./. https://answers.microsoft.com/en-us/windows/forum/all/microsoft-print-to-pdf-tool-create-file-0kb/c953c3b5-6e80-4f6d-a10a-d44f35701c51
  10. Microsoft Print to PDF tool create file 0kB

    in Windows 10 Drivers and Hardware
    Microsoft Print to PDF tool create file 0kB: I use Microsoft Print to PDF but it create file 0kB and can't open. I have tried all the ways on this forum but it still doesn't work. Help./. https://answers.microsoft.com/en-us/windows/forum/all/microsoft-print-to-pdf-tool-create-file-0kb/c953c3b5-6e80-4f6d-a10a-d44f35701c51