RED-4114: Fixed text rotation for rotation = 0 and text direction = 180
This commit is contained in:
parent
6fec4cc209
commit
95a2d71af0
@ -320,6 +320,14 @@ public class TextPositionSequence implements CharSequence {
|
|||||||
posYEnd = textPositions.get(textPositions.size() - 1)
|
posYEnd = textPositions.get(textPositions.size() - 1)
|
||||||
.getYDirAdj() - height + 2;
|
.getYDirAdj() - height + 2;
|
||||||
|
|
||||||
|
} else if (textPositions.get(0).getRotation() == 0 && textPositions.get(0).getDir() == 180f) {
|
||||||
|
posXInit = textPositions.get(0).getPageWidth() - getX1() + 1;
|
||||||
|
posXEnd = textPositions.get(0).getPageWidth() - getX2() + textPositions.get(0).getWidthDirAdj() - textPositions.get(textPositions.size() - 1)
|
||||||
|
.getWidthDirAdj() - 3;
|
||||||
|
posYInit = textPositions.get(0).getYDirAdj() - height + 2;
|
||||||
|
posYEnd = textPositions.get(textPositions.size() - 1)
|
||||||
|
.getYDirAdj() - height + 2;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
posXEnd = textPositions.get(textPositions.size() - 1)
|
posXEnd = textPositions.get(textPositions.size() - 1)
|
||||||
.getXDirAdj() + textPositions.get(textPositions.size() - 1).getWidthDirAdj() + 1;
|
.getXDirAdj() + textPositions.get(textPositions.size() - 1).getWidthDirAdj() + 1;
|
||||||
|
|||||||
@ -807,6 +807,31 @@ public class RedactionIntegrationTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testRotations() throws IOException {
|
||||||
|
|
||||||
|
System.out.println("testTableRedaction");
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
|
||||||
|
AnalyzeRequest request = prepareStorage("files/new/RotateTestfile.pdf");
|
||||||
|
analyzeService.analyzeDocumentStructure(new StructureAnalyzeRequest(request.getDossierId(), request.getFileId()));
|
||||||
|
AnalyzeResult result = analyzeService.analyze(request);
|
||||||
|
|
||||||
|
AnnotateResponse annotateResponse = annotationService.annotate(AnnotateRequest.builder()
|
||||||
|
.dossierId(TEST_DOSSIER_ID)
|
||||||
|
.fileId(TEST_FILE_ID)
|
||||||
|
.build());
|
||||||
|
|
||||||
|
try (FileOutputStream fileOutputStream = new FileOutputStream(OsUtils.getTemporaryDirectory() + "/Annotated.pdf")) {
|
||||||
|
fileOutputStream.write(annotateResponse.getDocument());
|
||||||
|
}
|
||||||
|
long end = System.currentTimeMillis();
|
||||||
|
|
||||||
|
System.out.println("duration: " + (end - start));
|
||||||
|
System.out.println("numberOfPages: " + result.getNumberOfPages());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFindDictionaryEntryInResizedEntryPosition() throws IOException {
|
public void testFindDictionaryEntryInResizedEntryPosition() throws IOException {
|
||||||
|
|
||||||
|
|||||||
@ -11,3 +11,5 @@ Sude Halide Nurullah
|
|||||||
Xinyi Y. Tao
|
Xinyi Y. Tao
|
||||||
Dorn
|
Dorn
|
||||||
Prasher
|
Prasher
|
||||||
|
RuleAnnotation270GradP
|
||||||
|
RuleAnnotation270GradLS
|
||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user