Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Export a text frame to pdf with the same dimension as that of text box

Community Expert ,
Aug 11, 2011 Aug 11, 2011

Hello All,

i have a problem, i need to export a text box on a page  to pdf using javascript. The requirement is that i need to create the pdf with the same dimensions as that of the textbox i.e the height and width of the exported pdf should be same as that of the text box.

I figured a method  "exportFile" on the "Textframe" object that is supposed to export an object to a file with the specified format. But using that with a textframe object results in the export of the whole page.

Please help me with the problem

Thanking all in advance.

TOPICS
Scripting
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 12, 2011 Aug 12, 2011

You  cannot influence the size of an exported PDF, it's always going to be the page size.

Is that enough to get you on your way?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 12, 2011 Aug 12, 2011

Thanks for your reply Jongware, but could you please tell then what for is the "exportFile" function on textframe do when all it does export the whole page with all the page contents.

Moreover could we do it this way by creating a new page of the size of text box, copying the box over to the new page(dimensions equal to the text box). And then exporting the new page.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 12, 2011 Aug 12, 2011

You can set your app prefs to copy as pdf… Call out to AppleScript or VB to write that clipboard data to file… It worked here…

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 12, 2011 Aug 12, 2011

Now that's what I call out of the (application) box thinking!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 12, 2011 Aug 12, 2011

Of course there are no options available to control the pdf data… but 'quick n dirty' pdfs to selection bounds you do get… Or so I do on my mac… can even check that the clipboard data is pdf…

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 12, 2011 Aug 12, 2011

Thanks Muppet, this seems to be an excellent workaround but this does not totally meet the requirements. What actually needs to be done is that we need to export a particular textframe to pdf with the same dimension as the dimension of the textframe, also we need to be able to control the quality of the generated pdf by applying a pdf preset.

Do you people think this is possible through scripting sdk or shall i look into the C++ sdk to meet these requirements.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 12, 2011 Aug 12, 2011
LATEST

Manan,

another idea: you could duplicate the text frame and move it to a brand new InDesign file with the page bounds set to the size of your text frame. Export it from there.

Uwe

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines