Skip to Main Content

Document Generator Pre-Built Function

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Issue with CR and LF in json. "\r" destroys table in template

mdehaanJan 31 2025

I have created a simple template in Word (sample.docx) and some json-files sample1.txt, sample2.txt and sample3.txt holding the data (I have uploaded the files as txt-files, as json is not allowed)
The data is coming from an Oracle table and printed to the file using UTL_FILE-package with a script like sample.sql
The text contains new-line charcaters to assure lines to be printed on a new-line.

In Oracle this new-line is translated as chr(13)||chr(10).
When converted to json, which is required when using the pre-built-function, this is translated as \r\n. (see various attempts with json-files sample1.txt, sample2.txt and sample3.txt, resulting in sample1.pdf, sample2.pdf and sample3.pdf)

The generated pdf's show that \r is ruining the table structure, while only using \n does not result in a new-line.

Is there someone out there that can help me solving this issue?
I really like the OCI-function solution, but when I won't be able to control the new-lines, then this will be quite useless for me.

This post has been answered by Buck Cronk-Oracle on Mar 6 2025
Jump to Answer

Comments

Processing

Post Details

Added on Jan 31 2025
2 comments
120 views