Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Can I use inline formatting with PDF?

Posted on 2004-08-30
11
Medium Priority
?
522 Views
Last Modified: 2012-06-27
Hi,

I'm dynamically generating PDF files. Can I use inline formatting, like tags in HTML or something?

For example: I display the text "My house is on fire." and I would like to display "house" in bold. Is there a way to do this without breaking up my string and format the pieces separately?

Thanks.
0
Comment
Question by:Otana
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
11 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 11929695
If you have access to the source application, do it there and recreate the PDF file. This is the simplest way to get formatting into PDF.

If you have Acrobat 6 (the full version), you can create annotations and use Rich Text formatting to get e.g. bold text. You would replace your original text with this text annotation, and then potentially flatten the file after  you edit it.

You can also use the touchup text tool and just select the "house" part of your string, and then select a bold typeface. This will however not reformat the complete string and e.g. adjust for the different character spacing of the bold font.

Can you tell me more about why you want to do this, there may be other solutions.
0
 
LVL 11

Author Comment

by:Otana
ID: 11929741
I'm using a third party object in a C# application to generate PDF files and place large blocks of text in them. I have those blocks of text stored in a DB. However, some parts of this text (names,...) should be bold. The third party object has some limitations so it would be easier if I could store formatting tags or something along with the text in the DB.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 11929809
In this case, you are out of luck (that is, if you don't want to create Rich Text formatted comments). However, if you need to place a large block of text on a PDF page, you need to split up the text into (at least) lines before you place it. It's possible that your 3rd party object does this for you, but in general, this is required.

Which 3rd party object are you using?
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 11

Author Comment

by:Otana
ID: 11929837
I'm using pdfLib.

The object allows me to create "textflows" which will split text into lines nicely. It also allows me to use "Justify" for alignment, which is what I need. However, if I split the text to format one part, I can not put it together again in a textflow, and I lose the ability to justify.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 11929924
I'm not aware of any pdflib features that would allow you to embed bold sections into normal text. Sorry.
0
 
LVL 11

Author Comment

by:Otana
ID: 11953244
I've found some documentation on the subject, it is possible.

Example: <fontname={Arial Bold}>

Thanks for the help.
0
 
LVL 9

Expert Comment

by:prifre
ID: 12115940
good work - pls have the admins to close the question.
( A different approach that I love is to patch the PS-file dynamically and use Distiller. But that presumes you love to hack PostScript...)

with a smile
/prifre
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 12118397
When using pdflib, there is no PostScript involved.
0
 
LVL 9

Expert Comment

by:prifre
ID: 12207203
It was meant as an aleternative to PDFlib. The one asking the question originally did not talk about PDFlib - and with ASP&Distiller the problem is solvable by dynamically patching PS-files.

with a smile
/prifre
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12442399
PAQed, with points refunded (125)

modulo
Community Support Moderator
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ability to edit PDF documents can be useful, however it may not be a straight forward process. Many non-technical people don't realise that a PDF document is basically an image rather than a text file, even if it contains nothing but text. If…
This article explains how to perform batch conversion of PDF, TIFF, and other image file formats into PDF, PDF Searchable, and TIFF files via a command line interface, using Nuance's latest document imaging software — Power PDF Advanced.
In this second video of the Xpdf series, we discuss and demonstrate the PDFimages utility, which, in a single command, is able to extract all the images from a PDF file and save each one in a separate image file (PBM, PPM, or JPG). Download and inst…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question