2012-11-15 26 views
5

के साथ एक PowerPoint प्रस्तुति मैं एक स्थिति है जिसमें मैं एक PowerPoint प्रस्तुति प्रोग्राम के निर्माण और एक वेब अनुप्रयोग के माध्यम से जिसके परिणामस्वरूप ppt फ़ाइल की सेवा करने के लिए है में हूँ, अधिमानतः का उपयोग कर रेल, जावास्क्रिप्ट या रूबी बनाएँ। क्या यह संभव है? यदि हां, तो कैसे और किस उपकरण के साथ?रेल

मैं इस समस्या से निपटने के तरीके के बारे में किसी भी और सभी सुझावों के लिए खुला हूं। धन्यवाद!

+1

यह एक PowerPoint फ़ाइल होने की जरूरत है या एक HTML प्रस्तुति है कि एक पूर्ण स्क्रीन ब्राउज़र में चलाता बनाने हैं पर्याप्त हो सकता है? – Bergi

+0

इसे एक पावरपॉइंट फ़ाइल होने की आवश्यकता है। – MalSu

+0

ठीक है; तो आप सर्वरसाइड जावास्क्रिप्ट के बारे में बात कर रहे हैं? – Bergi

उत्तर

4

http://tomasvarsavsky.com/2009/04/04/simple-word-document-templating-using-ruby-and-xml/

आप टेम्पलेट बना सकते हैं और मान भरने कर सकते हैं, इस दृष्टिकोण पर विचार करें।

कार्यालय ओपन एक्सएमएल फ़ाइल स्वरूपों

नए कार्यालय फ़ाइल स्वरूपों (.docx, .xlsx, .pptx फ़ाइलें) मूल रूप से XML फ़ाइलों के ज़िपित संग्रह कर रहे हैं। हमने वर्ड फाइल (.docx) पर ध्यान केंद्रित किया लेकिन यह दृष्टिकोण फ़ाइलों में से किसी भी अन्य प्रकार के साथ काम करेगा। प्रारूप के लिए विनिर्देश कई हजार पृष्ठों पर वजन का होता है। एक उद्देश्य के बिना खरोंच से एक फाइल का निर्माण लाइब्रेरी जो प्रारूप की सभी जटिलताओं को संभालती है, एक कार्य होगा। इसके बजाए, हमने वर्ड में टेम्पलेट्स का मसौदा तैयार किया और मार्कर को हमारे टेम्पलेटिंग इंजन को कहां मूल्य डालने के लिए कहा। हमने दस्तावेज़ गुणों का निर्माण किया जो डेटा मानों का संदर्भ देते हैं और उन्हें फ़ील्ड्स के रूप में उस स्थान पर दस्तावेज़ में जोड़ते हैं जहां मान डाले गए थे। उदाहरण के लिए, हम जैसे क्षेत्रों हो सकता है:

label_tag #{data[:user].name} 
label_tag #{data[:user].address} 
label_tag #{data[:booking].number} 
label_tag #{data[:booking].items.collect{|i| i.name}.join(‘,’)} 

अन्यथा, वहाँ का प्रयास किया गया (WIP तीन साल पहले अपलोड किया है, मैं इसे पूरा होने की उम्मीद नहीं है, लेकिन बनाने के लिए एक दृष्टिकोण बनाने में benfecial होना चाहिए स्लाइड) PowerPoint स्लाइड बनाने पर। यहाँ कोड

https://github.com/jpoz/rubypoint/blob/master/lib/rubypoint/presentation.rb

def new_slide 
    RubyPoint::Slide.new(self) 
end 
+0

पर भी एक नज़र डाल सकते हैं धन्यवाद! मैं आज रात देख रहा हूँ! – MalSu

+0

यह एकदम सही मार्गदर्शन है, मैं इसे उत्तर के रूप में स्वीकार कर रहा हूं, धन्यवाद! – MalSu

+0

क्या आपको इसका उपयोग करके समाधान मिला? मुझे इसी तरह की समस्या है – Joelio

4

यह गहरे लाल रंग का रत्न का एक नमूना वर्तमान स्वीकृत जवाब में बताया गया एक से अधिक परिपक्व लगता है।

https://github.com/pythonicrubyist/powerpoint http://rubygems.org/gems/powerpoint

require 'powerpoint' 

@deck = Powerpoint::Presentation.new 

# Creating an introduction slide: 
title = 'Bicycle Of the Mind' 
subtitle = 'created by Steve Jobs' 
@deck.add_intro title, subtitle 

# Creating a text-only slide: 
# Title must be a string. 
# Content must be an array of strings that will be displayed as bullet items. 
title = 'Why Mac?' 
content = ['Its cool!', 'Its light.'] 
@deck.add_textual_slide title, content 

# Creating an image Slide: 
# It will contain a title as string. 
# and an embeded image 
title = 'Everyone loves Macs:' 
image_path = 'samples/images/sample_gif.gif' 
@deck.add_pictorial_slide title, image_path 

# Specifying coordinates and image size for an embeded image. 
# x and y values define the position of the image on the slide. 
# cx and cy define the width and height of the image. 
# x, y, cx, cy are in points. Each pixel is 12700 points. 
# coordinates parameter is optional. 
coords = {x: 124200, y: 3356451, cx: 2895600, cy: 1013460} 
@deck.add_pictorial_slide title, image_path, coords 

# Saving the pptx file to the current directory. 
@deck.save('test.pptx')