Fixed the resize issue

This commit is contained in:
2026-07-14 08:02:11 +05:30
parent 6fd90ef7d4
commit fb0a78a405
17 changed files with 78 additions and 14 deletions

View File

@@ -121,6 +121,11 @@ class NativePDFService:
for line in block.get("lines", []): for line in block.get("lines", []):
for span in line.get("spans", []): for span in line.get("spans", []):
font_size = span.get("size", 12.0) font_size = span.get("size", 12.0)
# Ignore massive text (like diagonal watermarks)
if font_size > 60:
continue
space_threshold = font_size * 1.5 space_threshold = font_size * 1.5
font_family = span.get("font", None) font_family = span.get("font", None)

0
docengine/docengine.db Normal file
View File

View File

@@ -30,7 +30,7 @@
(cdkDropListDropped)="drop($event)" (cdkDropListDropped)="drop($event)"
[style.aspect-ratio]="page.width + ' / ' + page.height"> [style.aspect-ratio]="page.width + ' / ' + page.height">
<div *ngFor="let node of page.nodes" <div *ngFor="let node of page.nodes; let j = index"
cdkDrag cdkDrag
class="layout-node" class="layout-node"
[ngClass]="node.block_type.toLowerCase()" [ngClass]="node.block_type.toLowerCase()"
@@ -38,6 +38,8 @@
[style.top.%]="(node.y_coordinate / node.page_height) * 100" [style.top.%]="(node.y_coordinate / node.page_height) * 100"
[style.width.%]="(node.width / node.page_width) * 100" [style.width.%]="(node.width / node.page_width) * 100"
[style.height.%]="(node.height / node.page_height) * 100"> [style.height.%]="(node.height / node.page_height) * 100">
<i class="pi pi-bars drag-handle" cdkDragHandle title="Drag Item"></i>
<i class="pi pi-times close-icon" (click)="removeNode(i, j, $event)" title="Delete Item"></i>
<div class="node-type" *ngIf="node.height > 20">{{ node.block_type }}</div> <div class="node-type" *ngIf="node.height > 20">{{ node.block_type }}</div>
<div class="node-text">{{ node.text_value }}</div> <div class="node-text">{{ node.text_value }}</div>
</div> </div>

View File

@@ -63,9 +63,9 @@
background: rgba(255, 255, 255, 0.85); background: rgba(255, 255, 255, 0.85);
border: 1px solid var(--surface-border); border: 1px solid var(--surface-border);
border-radius: 2px; border-radius: 2px;
cursor: grab;
transition: box-shadow 0.2s, border-color 0.2s; transition: box-shadow 0.2s, border-color 0.2s;
overflow: hidden; overflow: hidden;
resize: both;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
@@ -107,6 +107,58 @@
&.table_header { border-color: #F59E0B; } &.table_header { border-color: #F59E0B; }
&.total { border-color: #10B981; } &.total { border-color: #10B981; }
&.tax { border-color: #EF4444; } &.tax { border-color: #EF4444; }
.drag-handle {
position: absolute;
top: 2px;
left: 2px;
font-size: 0.6rem;
color: var(--text-color-secondary);
background: rgba(255, 255, 255, 0.9);
border-radius: 2px;
padding: 2px;
cursor: grab;
opacity: 0;
transition: opacity 0.2s;
z-index: 20;
&:active {
cursor: grabbing;
}
&:hover {
color: var(--primary-color);
background: var(--primary-50);
}
}
&:hover .drag-handle {
opacity: 1;
}
.close-icon {
position: absolute;
top: 2px;
right: 2px;
font-size: 0.6rem;
color: var(--text-color-secondary);
background: rgba(255, 255, 255, 0.9);
border-radius: 50%;
padding: 2px;
cursor: pointer;
opacity: 0;
transition: opacity 0.2s;
z-index: 20;
&:hover {
color: var(--red-500);
background: var(--red-50);
}
}
&:hover .close-icon {
opacity: 1;
}
} }
/* Template Mapping Side */ /* Template Mapping Side */

View File

@@ -187,4 +187,9 @@ export class TemplatesComponent implements OnInit {
getCanvasDropLists() { getCanvasDropLists() {
return this.pages.map((_, i) => 'document-layout-list-' + i); return this.pages.map((_, i) => 'document-layout-list-' + i);
} }
removeNode(pageIndex: number, nodeIndex: number, event: Event) {
event.stopPropagation();
this.pages[pageIndex].nodes.splice(nodeIndex, 1);
}
} }

View File

@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("AdminService.API")] [assembly: System.Reflection.AssemblyCompanyAttribute("AdminService.API")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3d6614f408b65ff02c4ec3ab90c30c5348b110c2")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6fd90ef7d4b31df5e1484658299a2d1c93b2ec20")]
[assembly: System.Reflection.AssemblyProductAttribute("AdminService.API")] [assembly: System.Reflection.AssemblyProductAttribute("AdminService.API")]
[assembly: System.Reflection.AssemblyTitleAttribute("AdminService.API")] [assembly: System.Reflection.AssemblyTitleAttribute("AdminService.API")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@@ -1 +1 @@
470d40fea097e8ea2628b8dbff0e814f055e807a1029db302ae8002958fd34fd 0a1b6a4a45463f33f1b1d85ff83179c9a6942d1cf002eeb82f696f4cd717048c

View File

@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("AdminService.Application")] [assembly: System.Reflection.AssemblyCompanyAttribute("AdminService.Application")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3d6614f408b65ff02c4ec3ab90c30c5348b110c2")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6fd90ef7d4b31df5e1484658299a2d1c93b2ec20")]
[assembly: System.Reflection.AssemblyProductAttribute("AdminService.Application")] [assembly: System.Reflection.AssemblyProductAttribute("AdminService.Application")]
[assembly: System.Reflection.AssemblyTitleAttribute("AdminService.Application")] [assembly: System.Reflection.AssemblyTitleAttribute("AdminService.Application")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@@ -1 +1 @@
40ee97bcbb9c8fb6e68c5e6e397364a310fe04168b9555c38db03e648a8bbb51 c5363f90b727c17798757abb162df06c7cb9043744584a65732d3dc6e4527684

View File

@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("AdminService.Domain")] [assembly: System.Reflection.AssemblyCompanyAttribute("AdminService.Domain")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3d6614f408b65ff02c4ec3ab90c30c5348b110c2")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6fd90ef7d4b31df5e1484658299a2d1c93b2ec20")]
[assembly: System.Reflection.AssemblyProductAttribute("AdminService.Domain")] [assembly: System.Reflection.AssemblyProductAttribute("AdminService.Domain")]
[assembly: System.Reflection.AssemblyTitleAttribute("AdminService.Domain")] [assembly: System.Reflection.AssemblyTitleAttribute("AdminService.Domain")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@@ -1 +1 @@
a1dd58f2a98df609dbd0ab78d74cbab90d44d061f614e327a00488c4bc3adcfa 84da5ccf9e3c043a637edb6ff3581e3b021815c48800122ccfc2c109c11ce784

View File

@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("AdminService.Infrastructure")] [assembly: System.Reflection.AssemblyCompanyAttribute("AdminService.Infrastructure")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3d6614f408b65ff02c4ec3ab90c30c5348b110c2")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6fd90ef7d4b31df5e1484658299a2d1c93b2ec20")]
[assembly: System.Reflection.AssemblyProductAttribute("AdminService.Infrastructure")] [assembly: System.Reflection.AssemblyProductAttribute("AdminService.Infrastructure")]
[assembly: System.Reflection.AssemblyTitleAttribute("AdminService.Infrastructure")] [assembly: System.Reflection.AssemblyTitleAttribute("AdminService.Infrastructure")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@@ -1 +1 @@
64cded26218097f54300332a76d52d952dce41fbebb7e43e081b7061156e5b17 7ef0b1b39652d616b2621c866d18f601a7897511da17cc4c124fd260bb3131db

View File

@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Shared.Commons")] [assembly: System.Reflection.AssemblyCompanyAttribute("Shared.Commons")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3d6614f408b65ff02c4ec3ab90c30c5348b110c2")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6fd90ef7d4b31df5e1484658299a2d1c93b2ec20")]
[assembly: System.Reflection.AssemblyProductAttribute("Shared.Commons")] [assembly: System.Reflection.AssemblyProductAttribute("Shared.Commons")]
[assembly: System.Reflection.AssemblyTitleAttribute("Shared.Commons")] [assembly: System.Reflection.AssemblyTitleAttribute("Shared.Commons")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@@ -1 +1 @@
2046ef40f0c485f00e564e2f0066b9951c0c40d1128bc1f8bf42d372e39d058e 15b5555eb0a3987d28580be196a57888a7162f8edbf32845eafe6ab03017fd62

View File

@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Shared.Contracts")] [assembly: System.Reflection.AssemblyCompanyAttribute("Shared.Contracts")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3d6614f408b65ff02c4ec3ab90c30c5348b110c2")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6fd90ef7d4b31df5e1484658299a2d1c93b2ec20")]
[assembly: System.Reflection.AssemblyProductAttribute("Shared.Contracts")] [assembly: System.Reflection.AssemblyProductAttribute("Shared.Contracts")]
[assembly: System.Reflection.AssemblyTitleAttribute("Shared.Contracts")] [assembly: System.Reflection.AssemblyTitleAttribute("Shared.Contracts")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@@ -1 +1 @@
1ae4e40dd2596cce1ee09804327ae75af5447caabae810d6235b99e082b8031f c664c4c87752a413e6704dd91210581b8c484a3ab417298d878f5778b3373f5c