Forum Discussion
Log4TurtleShell
3 years agoFrequent Visitor
How to Decode a Base64 Encoded Bookmark
I am using this library, https://github.com/microsoft/PowerBI-JavaScript, to embed reports and handle bookmarks. I am calling capture() from the bookmarksManager object on my report. This returns a b...
Log4TurtleShell
3 years agoFrequent Visitor
Thank you for your reply.
Using atob() still returns gibberish. Am I wrong that the bookmark state should be able to be decoded to readable text?
ozpbi123
3 years agoRegular Visitor
Did you ever get a solution to this? I am also trying to decode the bookmark state, but unable to get anything other than gibberish as well.
- Log4TurtleShell3 years agoFrequent Visitor
Unfortunately, I did not. 😞
- Hettic11 year agoRegular Visitor
I did.
You can use below python script to decode the bookmark State.
The output is a JSON. Hope this helps.- Base64 Decode: Convert the Base64-encoded string back to its binary form.
- Gzip Decompress: Decompress the binary data to get the original string.
import base64 import gzip from io import BytesIO def decode_base64_gzip(encoded_string): # Step 1: Base64 decode decoded_data = base64.b64decode(encoded_string) # Step 2: Gzip decompress with gzip.GzipFile(fileobj=BytesIO(decoded_data)) as gzip_file: decompressed_data = gzip_file.read() return decompressed_data.decode('utf-8') # Example usage encoded_string = "your_base64_gzipped_string_here" decoded_string = decode_base64_gzip(encoded_string) print(decoded_string)