Syntax highlighting for PDFs? (2017 version)...

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
Phlawm53
Sr. Propeller Head
Posts: 442
Joined: Tue Mar 16, 2010 10:58 am
Location: San Francisco, CA
Contact:

Syntax highlighting for PDFs? (2017 version)...

Post by Phlawm53 »

------
I found some OLD threads about this but nothing recent -- SO I'll refresh the question:

Anyone found a way to do syntax highlighting of code that also works in Flare PDF Targets?

I've gotten Prism and Rainbow working in Flare online Targets. But even though Flare's PDF engine "knows" that there's an attempt to format the code -- the code text has a light-gray background -- the syntax highlighting doesn't work.

Any ideas?

Cheers & thanks,
Riley
SFO
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: Syntax highlighting for PDFs? (2017 version)...

Post by NorthEast »

I think both of those use javascript. For PDFs, you need a solution that doesn't require javascript.

I'd suggest finding a syntax highlighter where you can copy/paste your code, and it'll generate the formatted code ready to copy/paste back into your topic.
Phlawm53
Sr. Propeller Head
Posts: 442
Joined: Tue Mar 16, 2010 10:58 am
Location: San Francisco, CA
Contact:

Re: Syntax highlighting for PDFs? (2017 version)...

Post by Phlawm53 »

Dave Lee wrote:I think both of those use javascript. For PDFs, you need a solution that doesn't require javascript.

I'd suggest finding a syntax highlighter where you can copy/paste your code, and it'll generate the formatted code ready to copy/paste back into your topic.
What I've found so far are:
They output formatted HTML output that in theory can be pasted into Flare's text editor.

EDIT:
Found a way to use Pygments to wrap code samples in inline HTML formatting. The resulting highlighting appears in both online and PDF Targets. See:

viewtopic.php?f=6&t=29397

Cheers, thanks, & hope this helps,
Riley
SFO
Post Reply