C2026-041-invisible-position-changes-as-differences #807

Merged
jjenko merged 14 commits from C2026-041-invisible-position-changes-as-differences into Development 2026-09-03 08:56:33 -04:00
Showing only changes of commit 6376d4669b - Show all commits
+10 -1
View File
@@ -1418,7 +1418,10 @@ namespace Volian.Print.Library
float yoff = 0;
if (_MyHelper.DidFirstPageDocStyle) yoff = origYoff - (float)mySection.MyDocStyle.Layout.TopMargin;
// C2018-004 create meta file for baseline compares
Volian.Base.Library.BaselineMetaFile.WriteLine("WD Height={0} Width={1} scPgCnt={2} locEnd={3} pdfSz={4} xOff={5} yOff={6} ScPgNum {7}", fgPage.Height, fgPage.Width, sectPageCount, locEndOfWordDoc, pdfSize, (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0.0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0.0) + yoff, pageNumber);
//Volian.Base.Library.BaselineMetaFile.WriteLine("WD Height={0} Width={1} scPgCnt={2} locEnd={3} pdfSz={4} xOff={5} yOff={6} //ScPgNum {7}", fgPage.Height, fgPage.Width, sectPageCount, locEndOfWordDoc, pdfSize, (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0.0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0.0) + yoff, pageNumber);
mschill marked this conversation as resolved
Review
  1. Per John's email:

Suggest to add a program switch to generate (at the same time - in a separate file) a DebugMeta as it was along with the new DebugMeta.

That way one run of printing can generate both. The next time baselines are run, the Baseline.exe program can compare the older run - there really should not be any differences. If all good that we can move forward with using the new version of the DebugMeta file.

Otherwise comparing the new DebugMeta would generate even more false - differences.

Having a program switch to also generate the old style DebugMeta would keep Baseline testing backward compatible, should we find a need in the future.

1. Per John's email: Suggest to add a program switch to generate (at the same time - in a separate file) a DebugMeta as it was along with the new DebugMeta. That way one run of printing can generate both. The next time baselines are run, the Baseline.exe program can compare the older run - there really should not be any differences. If all good that we can move forward with using the new version of the DebugMeta file. Otherwise comparing the new DebugMeta would generate even more false - differences. Having a program switch to also generate the old style DebugMeta would keep Baseline testing backward compatible, should we find a need in the future.
Review

For the program switch are you referring to the new checkbox in the baseline program or a PROMS switch? I added the new checkbox to baseline.

For the program switch are you referring to the new checkbox in the baseline program or a PROMS switch? I added the new checkbox to baseline.
Review

this is an old item from a week or two ago.

outstanding items include:

1 performance item --- passing strings and if statements added to BaselineMetaFile.WriteLine
1 cleanup unnecessary usings
1 change to finding debug file ---- should check inside findfiles on an individual file basis whether to use truncated or not. also, should not concatinate strings --- should use path.combine or interpolated strings

this is an old item from a week or two ago. outstanding items include: 1 performance item --- passing strings and if statements added to BaselineMetaFile.WriteLine 1 cleanup unnecessary usings 1 change to finding debug file ---- should check inside findfiles on an individual file basis whether to use truncated or not. also, should not concatinate strings --- should use path.combine or interpolated strings
mschill marked this conversation as resolved Outdated
Outdated
Review

2, just to check --- Do we want to truncate or round or use ceiling or floor?

Thinking if we are doing this when writing the file (instead of when doing the compare), then truncate wont work as:
7.9999999999 would truncate to 7.99 and not match 8.00

2, just to check --- Do we want to truncate or round or use ceiling or floor? Thinking if we are doing this when writing the file (instead of when doing the compare), then truncate wont work as: 7.9999999999 would truncate to 7.99 and not match 8.00
Volian.Base.Library.BaselineMetaFile.WriteLine("WD Height={0} Width={1} scPgCnt={2} locEnd={3} pdfSz={4} xOff={5} yOff={6} ScPgNum {7}", fgPage.Height, fgPage.Width, sectPageCount, Truncate(locEndOfWordDoc, 2), Truncate(pdfSize, 2), (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0.0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0.0) + yoff, pageNumber);
mschill marked this conversation as resolved Outdated
Outdated
Review

For performance concerns. I would not recommend having additional paramaters with a string based option like "truncate_true" for example.

I would recommend that there be 3 WriteLine functions -

  1. A regular WriteLine that writes to both files.
  2. A WriteLineTruncated that writes to Only the Truncated file
  3. A WriteLineFullOnly that write to only the full file
For performance concerns. I would not recommend having additional paramaters with a string based option like "truncate_true" for example. I would recommend that there be 3 WriteLine functions - 1. A regular WriteLine that writes to both files. 2. A WriteLineTruncated that writes to Only the Truncated file 3. A WriteLineFullOnly that write to only the full file
Outdated
Review

This is still an open item as of 8/26. Also, it looks like you made changes to the Write function - but it is not used in PROMS - only WriteLine is.

This is still an open item as of 8/26. Also, it looks like you made changes to the Write function - but it is not used in PROMS - only WriteLine is.
AddImportedPageToLayer(cb.PdfWriter.DirectContent, _MSWordLayer, fgPage, (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0) + yoff);
// B2019-102 Handle PDF Destinations for Word Sections
if (ii == 0 && _MyHelper.MyPromsPrinter.SaveLinks)
@@ -1533,6 +1536,12 @@ namespace Volian.Print.Library
}
ProfileTimer.Pop(profileDepth);
}
public static float Truncate(float value, int digits)
{
double mult = Math.Pow(10.0, digits);
double result = Math.Truncate(mult * value) / mult;
return (float)result;
}
// B2019-152: AddMergedLandscapePage adds entries to the dictionary that keeps track of what pages in a pdf are landscape
// so that if merge is done, the pages that are landscaped can have landscaped page numbers placed on them
public static void AddMergedLandscapePage(VlnSvgPageHelper _MyHelper, string PDFFile)