![]() ![]() When saving with this mode, any previously saved metadata in the document is removed as well. Metadata: false - When saving, all the (visible) changes are saved back to the original image as is, and reopening this image will show these changes, but they will not be editable. ![]() To control how the backing image is saved, the ImageDocument#saveIfModified(metadata) method provides a parameter. If you don’t need to retain editability, you can strip all document metadata in the saved image file, which will also reduce the final file size. By default, image documents will stay editable after saving. You can use any of the save methods on ImageDocument, which will handle saving all changes back to the original image file. to make ImageDocument instances behave just like PdfDocument instances. Saving has been designed to be transparent, i.e. When using the preconfigured configuration instances returned by ImageDocumentLoader, these impractical annotation tools will be automatically disabled. For example, text selection- or text extraction-based annotations, such as highlight and underline annotations, don’t make sense for an ImageDocument because there will be no selectable text in the document. The zero point is at the bottom left, and it’s sized to match the image that was opened.Īlthough you can technically use any annotation type with ImageDocument, we recommend disabling certain annotation tools when working with image documents. The coordinate system of image documents is very similar to the one used for PDF documents. getDefaultImageDocumentActivit圜onfiguration(context) įinal PdfUiFragment fragment = omImageUri( this, uri) commit() final Uri uri = Uri.parse( "file:///android_asset/image.png") įinal PdfActivit圜onfiguration config = ImageDocumentLoader getDefaultImageDocumentActivit圜onfiguration(context) Val config: PdfActivit圜onfiguration = ImageDocumentLoader Val uri = Uri.parse( "file:///android_asset/image.png") Here’s how to load an image document from the app’s assets directory: Just like with PDF documents, image documents can be loaded from various sources, including the local file system, Android content providers, or the app’s assets. Supported image document formats are JPEG, PNG, and TIFF. ImageDocumentLoader provides several static methods that can be used to load ImageDocument instances from either a Uri or a DocumentSource. If you need to use an image as an annotation in another document, see our guide on image annotations. ℹ️ Note: This feature requires the Image Documents component to be enabled in your license. Take a look at ImageDocumentExample in the Catalog app or read our announcement blog post to learn how you can annotate PNG, JPEG, and TIFF images just like a PDF with Image Documents. Furthermore, image documents remain fully editable, even after saving them back to the original image file. To make use inside PdfActivity even simpler, we provide a prebuilt configuration that adjusts the UI so that it works great for images. All you need to do is pass your image source to the ImageDocumentLoader or PdfActivity, and we handle the rest. In PSPDFKit 4.6 for Android, we introduced a new class, ImageDocument, to make this process much simpler. You had to convert an image to PDF, be sure to update the annotation tools and UI to only show relevant options, and extract the image data back when a save occurred. While it has always been possible to annotate images in PSPDFKit, doing so previously required some extra code. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |