Tool for Decoding Bluebeam Configuration and Markup Files

  • Tool for Decoding Bluebeam Configuration and Markup Files

    Posted by Todd Owen on September 24, 2024 at 11:08 am

    I am sharing a HTML / JavaScript tool for viewing and editing* (* with caution) Bluebeam XML configuration and markup files as follows:

    btx – Tool Chest group

    bpx – Profile

    blx – Linetypes

    bhx – Hatches

    bax – Markups


    I recommend you set these extensions to open in Notepad or Notepad++ (preferred) by default. My reason for creating this tool was to take a set of QC markup tools I made for one discipline (Electrical) and duplicate them for other disciplines. The presence of a custom columns set made the process very tedious to perform manually.


    Have you ever viewed one of the filetypes above and noticed a <Raw> or <Script> tag with hexadecimal data beginning with “789c”? These signal zlib compressed (“zipped”) data which is a pain to deal with.

    Feel free to use the HTML file at [http_s://]bigisp.us[/bluebeam-xml.html] (hopefully this URL is allowed through the forum). No data is sent anywhere since all the processing occurs in your browser. You can download and run the file from your local hard drive if you want as well. It does grab the “pako” zlib library from cdn.jsdelivr.net, but feel free to review the HTML since there are several comments you may find helpful.

    You can drag and drop one of the file types above into the top window and press “Decode Text”, which will show the data in the lower window. From here you can edit the file and press “Encode Text” where it will place the file back into the format Bluebeam expects. Be aware, the zlib compression often gives a different result even if you didn’t edit anything. In all of my testing, this didn’t matter to Bluebeam, but “you edit at your own risk”.

    I’ve probably only decoded about half of the structured text in the <Raw> portions of the ‘btx’ files, and you can make changes which Bluebeam will fail to decode or create a tool which is totally incorrect, but fixes itself as soon as you manipulate it.

    I will post more information in this thread as I decode it. I commented out the <Icon> decompression for ‘bpx’ files since it’s a PNG graphic with nothing to edit. Also, be careful with any “stream” sections, since they have non-printable characters as they will break if edited.

    Some of the <ID> tags (16 uppercase characters) get compressed and some don’t. I haven’t figured out if this matters, so I decode them and prepend a “789c-” so I know which ones to re-encode and which ones not. If you highlight the ID in Notepad++, then all occurrences of the ID are highlighted. *Don’t change the ID.* Note: If I determine the unzipped version of the IDs work fine, then I may change the JavaScript to only decompress and not compress. Hopefully, I’ll get this on GitHub and let everyone in this group know.

    Please let me know if you have questions or requested feature enhancements. I hope this tool will help facilitate a full decoding of the Bluebeam structured text to help everyone!

    Troy DeGroot replied 1 week, 6 days ago 2 Members · 2 Replies
  • 2 Replies
  • Todd Owen

    Member
    September 24, 2024 at 11:37 am
    Points: 596
    Rank: UC2 Brainery White Belt UC2 Brainery White Belt Rank

    This is a custom callout definition decoded:

    <pre class=””> <ToolChestItem Version=”1″>
    <Name>BOODMBZMTTGDMCAS</Name>
    <Type>Bluebeam.PDF.Annotations.AnnotationFreeText</Type>
    <Raw><</DA(1 0 0 rg /Helv 10 Tf)/IT/FreeTextCallout/DS(font: Helvetica 10pt; text-align:left; margin:0pt; line-height:11.5pt; color:#FF0000)/RD[50 30 5 5]/CL[5.5 5.5 40 35 53.8 35]/TempBBox[0 0 260 48]/LE/OpenArrow/FillOpacity 0.8/Subj(Callout)/BSIColumnData[(Electrical)()()()()]/Subtype/FreeText/Rect[0 0 260 48]/F 4/C[1 1 1]/BS<</W 1/S/S/Type/Border>>/OC(Electrical)>></Raw>
    <X>5.5</X>
    <Y>5.5</Y>
    <Index>8</Index>
    <Mode>properties</Mode>
    </ToolChestItem>

    /DA(1 0 0 rg /Helv 10 Tf)/IT/FreeTextCallout is an older format for a red callout using 10-pt. Helvetica, which is the same as the HTML/CSS format /DS(font: Helvetica 10pt; text-align:left; margin:0pt; line-height:11.5pt; color:#FF0000).

    I used a white background /C[1 1 1] with a 80% fill opacity /FillOpacity 0.8. There is an open arrow /OpenArrow leader with a box around the text with zero margin margin:0pt; in the /DS part above.

    The layer is /OC(Electrical) and will be created if it isn’t already in the PDF file. We had a set of five custom columns with “Discipline” being the first one, so it has a default in the Electrical Tool Chest version /BSIColumnData[(Electrical)()()()()].

    If the icon is in “drawing” mode (most people use “properties” mode, the temporary bounding-box /TempBBox[0 0 260 48] is how the inserted tool will appear until it’s inserted into the PDF, the it will resize. The X-axis is always left to right, but sometimes the Y-axis starts at zero in the upper left-hand corner of the PDF, and sometimes in the bottom-left, YMMV.

    The X, Y is typically set to the lower-left corner of the arrow where the /CL[5.5 5.5 40 35 53.8 35] element, in this case the arrowhead starts, goes northeast, the flattens out; think of this as [x1 y1 x2 y2 x3 y3]. The units of measurement are not consistent. It would be great to get others to participate in this. As an example, change the dimensions in the properties menu, then add to a Tool Chest, then export and see how these number change.

    I hope this helps get you going!

  • Troy DeGroot

    Organizer
    September 24, 2024 at 7:07 pm
    Points: 23,102
    Rank: UC2 Brainery Brown Belt III UC2 Brainery Brown Belt III

    Welcome to the community @jtoddowen

    Thanks for sharing such a great, detailed tip. I’ll have to dig deeper into this one!

Log in to reply.