Home Devices

Corrupted pdf-files

edited December 2010 in Devices
Hello,

we released a new version of our software that includes the latest
reportbuilder.
We have several customer complaining that saving a report to pdf gives
an empty pdf!
As we generate the pdf and send invoices to customers by mail, customers
receive empty invoices for the moment.
This is really painfull.
It seems to happen only once in a while, how can be fix this.
This is the code we are using:

if fileExists(ExtractFilepath(Application.exename) + 'tempfile.pdf')
then DeleteFile(ExtractFilepath(Application.exename) + 'tempfile.pdf');
report.ShowPrintDialog := False;
report.DeviceType := dtPDF;
report.PDFSettings.OpenPDFFile := False;
report.TextFileName := ExtractFilepath(Application.exename) +
'tempfile.pdf';
report.Print;

Comments

  • edited December 2010
    Hello,

    Please send a simple example demonstrating this issue in zip format to
    support@digital-metaphors.com and I'll take a look at it for you.


    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2010
    Op 9/12/2010 16:11, Nico Cizik (Digital Metaphors) schreef:

    Problem is that I can't simulate it.
    We get reports from customers, how can we get rid of this problem as
    soon as possible.
    Would downgroading to version 12.02 be a solution?
    It has been working for over a year perfectly with version 11.08.
    I can't downgroad to this version as the application contains over 300
    reports that have been modified to the version 12 format.

    The only thing I can send you is the content of the blob fields in the
    database in pdf and raf format.
    Is that something you can work with?

    Thx,
    Bernaert Dominique
  • edited December 2010
    Hi Bernaert,

    Yes, you can send me the archive files of the reports that have the issue
    and I can test them here. Please understand however that if I'm unable to
    recreate the issue here, there is very little chance of tracking down the
    problem. Any additional information about the users that are getting this
    error would also be helpful.

    Please send the example files in zip format to
    support@digital-metaphors.com.


    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2011
    I have been this problem too. When I had reportbuilder 10.09 works. I get
    12.04 and this problem begun.

    Any ideas. I need a solution cause I have customers who use and they get
    errs. I work with Delphi XE profession and ReportBuilder 12.04 Enterprise.
    This problem happens just some PCs another works.

    Douglas Carlos

  • edited July 2011
    Douglas,

    Please provide more information on the exact errors you are receiving.

    Please send a simple example demonstrating the issue to
    support@digital-metaphors.com in .zip format and I'll take a look at it
    for you.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2011
    Hi everyone!

    I have same problem here - empty pdf files. I work with Delphi and also
    use ReportBuilder 12.04 Enterprise. But there is one thing I have
    discovered on computers with windows7 and it seems to be related to
    operating system's "Regional and Language options" settings.

    In practice please can someone (one with empty pdf problem) try to
    change "Current format" setting (in Regional and Language options) to
    any other country, then apply settings, and then change it back to your
    original country. I have found that this action resolves empty pdf
    problem in every Windows 7 computer.

    Some background information can be found here, please read, these
    explain one windows7 bug that may appear with many applications
    programmed with Delphi.

    http://stackoverflow.com/questions/1767946/getthreadlocale-returns-different-value-than-getuserdefaultlcid

    And more detailed:
    http://blogs.msdn.com/b/michkap/archive/2010/03/19/9980203.aspx

    To summarize: The relevant API calls all operate on registry values that
    can be found at HKCU\Control Panel\International. The value "Locale" is
    maintained for backward compatibility reasons and under normal
    circumstances is kept in synch with its newer counterpart called
    "LocaleName". This synch process however doesn't work under some
    circumstances. Anyway, the GetThreadLocale API call gets its return
    value from the "Locale" registry entry mentioned above, while the others
    (GetUserDefaultLCID, GetSystemDefaultLCID, etc) use the "LocaleName"
    registry entry.

    Not every Windows7 has this situation , but many pre-installed
    computers for european market have this problem.
    So far I have not found any Delphi programming workaround for empty
    pdf problem. That manual country change as described above is acctually
    not convenient for clients.

    All additional questions are welcome.

    Gunnar


  • edited August 2011
    Hi Gunnar,

    Starting with RB 12, it is now necessary to change the ppFormatSettings
    global property each time you alter the Delphi global FormatSettings
    values. Otherwise there is a possibility of getting empty PDF output.

    For instance...

    uses
    ppUtils;

    begin

    DecimalSeparator := ',';
    ThousandSeparator := '.';

    ppFormatSettings.DecimalSeparator := DecimalSeparator;
    ppFormatSettings.ThousandSeparator := ThousandSeparator;

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2011
    Hello,

    Thank you Nico, that information was very helpful!


    Gunnar


This discussion has been closed.