Skip to content

pdf.mark #27

Description

@Sourgin

Hi, so I did a thing with your stuff in order to read PDF.mark an convert them to png.

In essence

parse.py 
class SupernoteXParser(SupernoteParser):
    SN_SIGNATURES = [
+       'markSN_FILE_VER_20220013'  // ADD recognition for the file type

converter.py
def _flatten_layers(self, page, imgs, visibility_overlay=None):
-        for name in reversed(layer_order):
-            is_visible = visibility.get(name)
-            if visibility_overlay is not None:
-                overlay = visibility_overlay.get(name)
-               if overlay == VisibilityOverlay.INVISIBLE or (overlay == VisibilityOverlay.DEFAULT and not is_visible):
-                    continue
-            else:
-                if not is_visible:
-                    continue
-            img_layer = imgs.get(name)
-            if img_layer is not None:
-                if name == 'BGLAYER':
-                    # convert transparent to white for custom template
-                    img_layer = self._whiten_transparent(img_layer)
-                flatten_img = flatten(img_layer, flatten_img)

+       img_layer = imgs.get(layer_order[0])
+       flatten_img = flatten(img_layer, flatten_img)

If it helps you. For my project 90% of the code is irrelevant and will strip down everithing I can, just need the result of all PDF.Mark > PNG for now, but it can help other people if PDF.mark conversion is integrated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions