PDF writer

Hey…

I just encountered what may be a bug in the PDF writer posted on BeBits. I accidently went “save as” on a Gobe Productive and overwrote my schedule.pdf file as a GP file. GP took over the MIME type and the icon changed. So, oops, I went and saved somewhere else, and then printed using the PDF writer driver, saving over top of schedule.pdf again. But the driver didn’t take over the MIME type like GP did, so even though it wrote a PDF file over top schedule.pdf, I could no longer launch it, because it would be opened in Gobe.

Not sure if this is what happens on the current working version…

Kev

The standard behaviour of BeOS when a file is overwritten is, to keep the attributes of the overwritten file. This can be good and bad (e.g. BePDF remembers the page number and position and more in attributes).

To fix the problem PDF Writer would have to set the MIME type and icons. Any Volunteer?

In your case to work around the problem, you could have changed the MIME type of the file with the corresponding Tracker add-on to application/pdf.

Michael,

Quote:
To fix the problem PDF Writer would have to set the MIME type and icons. Any Volunteer?

I can add such code. Does just setting the application/[x-]pdf MIME type will be enough?

The icons and preferred application would have to be updated as well, if they are not associated with PDF. But I guess this is hard/impossible to determine so I propose not to change them at all.

I thing always deleting the attributes for the icons and pref. app. is not an option, because this is usually not desired if the file was already a PDF file.

Philippe, please feel free to make the necessary changes.

  • Michael
Quote:
Philippe, please feel free to make the necessary changes.
Done. I've re-enabled Title and Creator file attributes too. Or was it just nont-implemented? Can't remember why PDFWriter::SetAttribute() method was still empty...
phoudoin wrote:
Done. I've re-enabled Title and Creator file attributes too. Or was it just nont-implemented? Can't remember why PDFWriter::SetAttribute() method was still empty...

Thanks. I think someone just forgot to implement it :wink: