Merge pull request 'fix: build errors, and annotation issues' (#37) from furqan into dev

Reviewed-on: https://gitea.maskantech.in/gitea_admin/pdf/pulls/37
This commit is contained in:
furqan
2026-06-09 05:39:19 +00:00
5 changed files with 5 additions and 2 deletions
Binary file not shown.
-1
View File
@@ -4,7 +4,6 @@ import type { Rect } from '../lib/coordinateMapping';
export interface Annotation {
id: string;
type: 'highlight' | 'signature' | 'strikeout' | 'comment' | 'ink';
pageIndex: number;
bbox: Rect;
color?: string;
author: string;
-1
View File
@@ -256,7 +256,6 @@ export const PDFViewer = React.forwardRef<PDFViewerRef, PDFViewerProps>(({
color: highlightColor,
author: 'Current User',
content: text,
pageIndex: pageIndex,
};
onAnnotationAdded?.(newAnno);
}
+4
View File
@@ -142,6 +142,10 @@ std::expected<std::vector<std::string>, pdfengine::EngineError> WasmMockPage::ex
return std::vector<std::string>();
}
std::expected<std::vector<pdfengine::PdfPage::AnnotationInfo>, pdfengine::EngineError> WasmMockPage::extractAnnotations() const {
return std::vector<pdfengine::PdfPage::AnnotationInfo>();
}
std::expected<double, pdfengine::EngineError> WasmMockPage::getGlyphWidth(const std::string& fontName, uint32_t charcode, double fontSize) const {
(void)fontName; (void)charcode;
return 6.0 * (fontSize / 12.0);
+1
View File
@@ -22,6 +22,7 @@ public:
[[nodiscard]] std::expected<pdfengine::PageModel, pdfengine::EngineError> extractDocumentModel() const override;
[[nodiscard]] std::expected<std::vector<pdfengine::FontInfo>, pdfengine::EngineError> getFonts() const override;
[[nodiscard]] std::expected<std::vector<std::string>, pdfengine::EngineError> extractAnnotationsText() const override;
[[nodiscard]] std::expected<std::vector<pdfengine::PdfPage::AnnotationInfo>, pdfengine::EngineError> extractAnnotations() const override;
[[nodiscard]] std::expected<double, pdfengine::EngineError> getGlyphWidth(const std::string& fontName, uint32_t charcode, double fontSize) const override;
[[nodiscard]] pdfengine::DevicePoint pageToDevice(const pdfengine::Point2D& pagePoint, int deviceWidth, int deviceHeight, int rotate = 0) const noexcept override;