Skip to main content
June 15, 2009
Answered

How do I retain the formating of code snippets?

  • June 15, 2009
  • 2 replies
  • 1667 views

Our documentation group is curently using Frame 7.2 with Acrobat 9. We have documents that contain code snippets that customers can copy and paste into their code. Unfortunately, when out FrameMaker files are converted to PDF a carriage return is added to the end of any line that wraps. This introduces errors into the customer's code. Does anyone know of a workaround for this? Correcting it in the PDF is an unworkable solution due to the number and length of documents.

    This topic has been closed for replies.
    Correct answer JohannesKrueger

    There are no line breaks on the copied text when the "Tagged PDF" option is enabled in FM and, of course, the tag for the listing para format is included. This works for me on Framemaker 8.0p277 and Acrobat Distiller 7.1 on Windows XP. Maybe anyone can confirm this?

    Best Regards,

    Johannes

    2 replies

    JohannesKruegerCorrect answer
    Inspiring
    June 18, 2009

    There are no line breaks on the copied text when the "Tagged PDF" option is enabled in FM and, of course, the tag for the listing para format is included. This works for me on Framemaker 8.0p277 and Acrobat Distiller 7.1 on Windows XP. Maybe anyone can confirm this?

    Best Regards,

    Johannes

    June 18, 2009

    That seems to work perfectly. Thanks!

    June 15, 2009

    Have you seen examples of PDFs from other applications where the carriage returns don't occur in wrapped lines?

    As far as I know this is standard behavior for PDF copying of content.

    June 16, 2009

    Possibly. However I'd still like to know if someone has found a workaround for the problem. In programmer's guides especially, this behavior is an actual detriment to person using the guide.

    Inspiring
    June 16, 2009

    There are variations between authoring applications, and as far as I know, no way of controlling this aspect. Plus, there are other factors that could adversely affect the code copied from a PDF and pasted elsewhere. For best results, I recommend embedding the code fragments as files in the PDF.

    For additional information as examples, see http://www.microtype.com/ImprovePDF18.html


    Shlomo Perets

    MicroType, http://www.microtype.com
    FrameMaker/Acrobat training & consulting * FM-to-Acrobat TimeSavers/Assistants
    Template Design, Single Sourcing, FM-to-PDF & Acrobat courses