Fix: Missing text and annotationlayer imports for React-PDF #185
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@cyntler
The PDFRender uses PDF-React as Library. There the imports for the Text and Annotationlayer are missing. This causes
incorrect render behaviour. I added the missing imports according to the PDF-React documentation: Support for text and annotationlayer . This issue was likely cause by updating the React-PDF dependency in #88 from 5.7.2 (no text and annotationlayer support) to 7.5.0.
Before:
The text and annotationlayer were improperly rendered below the pdf canvas. This also prevented from text being directly highlightable and therefore copyable from the rendered PDF.
![grafik](https://private-user-images.githubusercontent.com/38780545/274659861-a51de182-5005-4e99-8944-04c29913bb73.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1OTk4NDcsIm5iZiI6MTczOTU5OTU0NywicGF0aCI6Ii8zODc4MDU0NS8yNzQ2NTk4NjEtYTUxZGUxODItNTAwNS00ZTk5LTg5NDQtMDRjMjk5MTNiYjczLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA2MDU0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZhYTQxNmY5ZWQyZDY3NjI5ZWY5NmUxNzkwNDM0ZjZkODYxYzY5ZjU2MDM0ZGQwNmY3NzVhZjBiMThhMTk0MDAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.qbfcU0vE0vu4wsJXwMiT6nACkCSUj17hm6ZdQQt-1oQ)
After:
The text and annotationlayer are correctly rendered on top of the pdf canvas. The text is highlightable and copyable.
![grafik](https://private-user-images.githubusercontent.com/38780545/274660412-4babac6a-e989-44e0-b227-84a62ec21c89.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1OTk4NDcsIm5iZiI6MTczOTU5OTU0NywicGF0aCI6Ii8zODc4MDU0NS8yNzQ2NjA0MTItNGJhYmFjNmEtZTk4OS00NGUwLWIyMjctODRhNjJlYzIxYzg5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA2MDU0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU5MDcxN2JhMWUxZDgxZDhmNjZiZjg5NmE0MTFlZDM2ODIzYjg0Yzc4MjZlOTdmZDA2MmM3NWNjMjcyYmUxMzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.0JQ0O9wYoJ2_5eWrM2VUxF_53s-PSBhRActYPMCxyJs)