Possible bug on PDF creation?

Hi

Not sure if this a bug or not. What I have discovered is:
Export the report using FastReports PDF export, and the resulting PDF cannot be opened on an Apple MAC.
Print the report to PDF (using PDFWriter) and then the report CAN be opened on an Apple MAC.

Any ideas? For the time being, the solution is to use the PDFWriter, but I would not like to enforce this on end-users, if possible.

Cheers,
Regan

Comments

  • edited December 2009
    Here is some code snippets for sending the report to Adobe PDF printer:

    ...

    //try and set the Report's printer to Adobe PDF, first check if its installed - basic check only
    if not chkUseInternalPDF.Checked then
    begin
    iPrinterIndx := Printer.Printers.IndexOf('Adobe PDF');
    if iPrinterIndx >= 0 then
    begin
    frxInvoice.PrintOptions.Printer := 'Adobe PDF';
    frxInvoice.SelectPrinter; //<<--- MUST call this otherwise printer will NOT be set and will send to default printer instead
    end
    else
    raise Exception.Create('The Adobe PDF printer could not be found. Please ensure that you have Adobe Acrobat version 7 or later installed!');
    end;

    ... //loop through all the invoices we want to print and for each do

    if chkUseInternalPDF.Checked then
    frxPDFExport.FileName := stFileName
    else
    //Prevent Adobe from prompting for filename
    SetRegistryKey('\Software\Adobe\Acrobat Distiller\PrinterJobControl',Application.ExeName,stFilename);

    ...

    if chkUseInternalPDF.Checked then
    frxInvoice.Export(frxPDFExport)
    else
    frxInvoice.Print;

    Hope this helps someone else.
    Regan
  • Anu de DeusAnu de Deus Hampshire, UK
    edited 4:00AM
    Nice code, I'll probably use it.
    Thanks
  • edited 4:00AM
    Apple Macintosh processors use big-endian byte order, AMD and Intel processors use little-endian byte order. This means, that a document created in AMD or Intel processor (using standard programming techinques) cannot be opened by Macintosh and vice versa. Currently FR does not support Macintosh.
  • Anu de DeusAnu de Deus Hampshire, UK
    edited 4:00AM
    Draeden wrote: »
    Apple Macintosh processors use big-endian byte order, AMD and Intel processors use little-endian byte order. This means, that a document created in AMD or Intel processor (using standard programming techinques) cannot be opened by Macintosh and vice versa. Currently FR does not support Macintosh.

    I'm sorry, but that's such a bunch of crap!
    #1 - Apple MAC uses INTEL!!!!!!!!!!! Long are gone the times of Motorola and PowerPC, just to let you know. Oh, and Mackintosh is not used as a brand for at least 5 years!

    #2 - There is no such a thing as a PDF file for Macs, and another one for PCs. Or have you ever seen a webpage (you can try the FastReports one) with a link:
    - For a Manual in PDF format for MACs, click here
    - For a Manual in PDF format for PCs, click here ??????????

    No? I thought so.

    Now please, would someone look into the issue?


  • edited 4:00AM
    Hi

    Having looked at this issue briefly, I think the issue is about the encoding that is used by FastReports. I believe that it uses WinAnsiEncoding which is not compatible with MACs. Possibly we could have the encoding as a PDF Export property or set to a MAC compatible one.

    I have to agree with Anu, it has nothing to with the processor. A simple example (as stated previously) is that I use PDFWriter on the same machine as FastReports to create the pdf. PDFWriter encodes the pdf differently than FastReports ... open the pdf in a text viewer and you will see the encoding is different (search for encoding in your text viewer). If it was the processor ANY pdf created on an INTEL/AMD processor based machine (this would include the latest MACs) would not be compatible on a MAC.

    Just my 2 cents.. [img]style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> Regan[/img]
  • edited 4:00AM
    Has any progress been made on fixing pdf's for the mac? We have to print to a pdf writer instead of using fast reports to get pdf's that will display properly. The pdf's can open just fine on the mac but they are missing pieces of content, usually images or gradients.

    I ran a quick test by exporting the "Simple List" basic report from the example application. On my mac the entire header is missing. If I embed fonts I can see the red column headers but the gradient is missing. I've tried turning on and off different options but I can't get the gradient to appear in Preview. If I open the pdf in Acrobat Reader pro on my mac the gradient is there so I'm not sure why Preview doesn't like it but Preview is the standard way to view pdf's.

    Any ideas?

    Troy
  • edited 4:00AM
    PDF/A is being developed. When this will be done, generated PDFs should be able to be opened on Macs.
  • edited 4:00AM
    I just tried out the latest version of the software and it still has some issues so I'm assuming PDF/A isn't done yet. Do you know the timeline for its release by chance?

    Thanks,
    Troy
    Draeden wrote: »
    PDF/A is being developed. When this will be done, generated PDFs should be able to be opened on Macs.
  • edited 4:00AM
    PDF/A will be available in FR5. Probably this autumn.
  • edited 4:00AM
    Draeden wrote: »
    PDF/A will be available in FR5. Probably this autumn.

    Any news about this ?
    I need PDFs created for Windows and Mac...

    Currently working with latest version 4

    best regards
    Holger
  • edited 4:00AM
    Yeah, i remember FR5 being announced for Summer... 2011.

    Any news about it? The product as is is already great. But some of the new features announced (new interface, pdf417 barcodes, PDF/A support... ) i'm really looking forward to.
  • gpigpi
    edited 4:00AM
    wrote:
    new interface
    What new interface? Ribbon? This will be really useless feature for me
  • edited 4:00AM
    wrote:
    What new interface? Ribbon? This will be really useless feature for me
    For me it's a plus. But even without it, better PDF output is a really pressing issue I think for pretty much everybody who exports PDFs.

    The pdf417 barcode support I don't think is that generally needed, but I'm really looking forward to it. Right now I have to use really bad third party software.
  • I've asked this to support and I was told the same old story that PDF/A is what we need. That's rubbish. The files are generated wrongly by Fast Report when fonts are not embedded. And embedding fonts mean creating files of about 800 KB for one page, so they are practically useless.

    Just to test this, print a report using PDF Creator. It will create a PDF 1.4 file that can be read perfectly by any reader (iPad, Google Chrome, etc.)

    Guess we Fast Report 4 customers are not important enough. Everything keep being pushed to FR5 which is about a year late.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.