When I try to generate a PDF document, DelphiDoc hangs while creating the index for the letter 'C' and the resulting file keeps growing forever (I stopped at 200 MB).
I tried to find the problem in the source code, but running the source in the debugger even produces errors already at parsing prventing me to proceed to generate.
Can you help me?
(I am using Delphi 5 under WinXP)
Ernst
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
the PDF generator has to almost render the pages itself, this includes determining when to break each line. The index consists of a table with three columns, making a "line" quite short. The algorithm breaks lines at whitespaces (i.e. spaces) but can also break words, but only "identifiers", because it only breaks words before capital letters (like "GetSomeRealCoolValue" can be breaked at four positions). Sadly, I forgot to implement a "fail-safe" break-condition in case a word never fits on a line and cannot be breaked.
So the algorithm always finds that there is some text left to be printed, but it does not fit on the remnant of the current line. So it starts a new line and tries again, which grows the PDF file to impressive sizes as you noticed.
I could give you the code for the fail-safe, it's only a dozen lines, but it won't do you any good if you can't compile the source code. I'm developing with Delphi 4 and check with Kylix (roughly Delphi 6) and sometimes Delphi 7. I've no access to Delphi 5, so I can't help you much with that problem. Are you sure you set the right version of Delphi to emulate in DelphiDoc when parsing your source code?
Furthermore I'm currently in a revamp of the generators and right in the middle of it. It'll probably take several weeks before I'm ready for a new release.
A quick solution for now would be to tell the generator not to generate the index. If you really need the PDF only for printing the index won't help much anyways, it does not contain the page numbers (that's what the Table Of Contents at the beginning is for). This can be done by setting the option "DocumentationSectionsFilter" to "I" ("I" for "Index"), it is in the category "Generation.Filter".
Another solution would be to generate LaTeX files instead with the corresponding generator and generate a PDF document from it. But of course you need to have LaTeX installed and may have to tweak a few options in the main file, which can take time if you are not familiar with LaTeX.
Best regards,
Gerold
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When I try to generate a PDF document, DelphiDoc hangs while creating the index for the letter 'C' and the resulting file keeps growing forever (I stopped at 200 MB).
I tried to find the problem in the source code, but running the source in the debugger even produces errors already at parsing prventing me to proceed to generate.
Can you help me?
(I am using Delphi 5 under WinXP)
Ernst
Hello,
the PDF generator has to almost render the pages itself, this includes determining when to break each line. The index consists of a table with three columns, making a "line" quite short. The algorithm breaks lines at whitespaces (i.e. spaces) but can also break words, but only "identifiers", because it only breaks words before capital letters (like "GetSomeRealCoolValue" can be breaked at four positions). Sadly, I forgot to implement a "fail-safe" break-condition in case a word never fits on a line and cannot be breaked.
So the algorithm always finds that there is some text left to be printed, but it does not fit on the remnant of the current line. So it starts a new line and tries again, which grows the PDF file to impressive sizes as you noticed.
I could give you the code for the fail-safe, it's only a dozen lines, but it won't do you any good if you can't compile the source code. I'm developing with Delphi 4 and check with Kylix (roughly Delphi 6) and sometimes Delphi 7. I've no access to Delphi 5, so I can't help you much with that problem. Are you sure you set the right version of Delphi to emulate in DelphiDoc when parsing your source code?
Furthermore I'm currently in a revamp of the generators and right in the middle of it. It'll probably take several weeks before I'm ready for a new release.
A quick solution for now would be to tell the generator not to generate the index. If you really need the PDF only for printing the index won't help much anyways, it does not contain the page numbers (that's what the Table Of Contents at the beginning is for). This can be done by setting the option "DocumentationSectionsFilter" to "I" ("I" for "Index"), it is in the category "Generation.Filter".
Another solution would be to generate LaTeX files instead with the corresponding generator and generate a PDF document from it. But of course you need to have LaTeX installed and may have to tweak a few options in the main file, which can take time if you are not familiar with LaTeX.
Best regards,
Gerold