WpTools 6.14
When I create rtf files with Word and then open in WPTools my page layout information is wrong. The problem seems to be with section breaks. When a document has section breaks on every page, the page layout information (margins, footer margins, etc.) are wrong. For example, page 1 is being set to 1/2" margins by default no matter what, then page 2 gets margins that were defined on page 1, then page 3 gets margins that were defined on page 2 and so on. It's like a page index is out of order. After looking at the WPTools source code I found a fix. In the unit WPIOReadRTF.pas I change the following...
Code
TWPRTFReader.ChangeProp(ipropCode, Value: Integer; Alt: Boolean = FALSE);
(go to around line 5822 - 5832)
ipropNewSection: // case statement
{$IFDEF WP6}
if FLoadInHeaderFooter then
begin
// Ignore Sections in header and footer texts (Word does such things!)
Ignore;
end else
if Value = 1 then // \sectd
begin
// Set section default - sectd. Use the Document Default Values
** Changed this** bUseSectdLayout := false; //*** CHANGE THIS TO FALSE TO PREVENT SECTIONS FROM USING PREVIOUS PAGE LAYOUT
SectdLayout.paperw := DefLayout.paperw;
SectdLayout.paperh := DefLayout.paperh;
SectdLayout.margl := DefLayout.margl;
SectdLayout.margr := DefLayout.margr;
SectdLayout.margt := DefLayout.margt;
SectdLayout.margb := DefLayout.margb;
SectdLayout.marg_header := DefLayout.marg_header;
SectdLayout.marg_footer := DefLayout.marg_footer;
Layout.marginmirror := DefLayout.marginmirror;
Layout.landscape := DefLayout.landscape;
end else
Alles anzeigen
I don't know if this is the correct fix or not. If anyone has a better fix please let me know.
Thanks,
Tom