Comments (11)
@dung1764 At the moment, no. But any PR are welcome :)
OpenXML :
- http://officeopenxml.com/prNotesSlide.php
- http://msdn.microsoft.com/en-us/library/office/gg278319(v=office.15).aspx
Fichier .rels
<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide" Target="../notesSlides/notesSlide1.xml"/>
notesSlides1.xml
<!-- top -->
<p:notes xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
<p:sp>
<p:nvSpPr>
<p:cNvPr id="45" name="PlaceHolder 1"/>
<p:nvPr>
<p:ph type="body"/>
</p:nvPr>
OpenDocument :
<office:presentation>
<draw:page draw:name="page0" draw:style-name="dp1" draw:master-page-name="Standard" presentation:presentation-page-layout-name="AL1T0">
<draw:frame draw:style-name="gr1" draw:layer="layout" svg:width="15.875cm" svg:height="7.997cm" svg:x="4.498cm" svg:y="4.763cm">
<draw:text-box>
<text:p text:style-name="P1">
<text:span text:style-name="T1">Thank you for using PHPPowerPoint!</text:span>
</text:p>
</draw:text-box>
</draw:frame>
<presentation:notes draw:style-name="dp2">
<draw:page-thumbnail draw:style-name="gr2" draw:layer="layout" svg:width="14.848cm" svg:height="11.136cm" svg:x="3.075cm" svg:y="2.257cm" draw:page-number="1" presentation:class="page"/>
<draw:frame presentation:style-name="pr1" draw:layer="layout" svg:width="16.799cm" svg:height="13.364cm" svg:x="2.1cm" svg:y="14.107cm" presentation:class="notes">
<draw:text-box>
<text:p>Test</text:p>
<text:p/>
<text:p/>
<text:p>Test2</text:p>
<text:p/>
<text:p/>
<text:p>Test3</text:p>
<text:p/>
<text:p/>
<text:p>OpenDocument rocks</text:p>
</draw:text-box>
</draw:frame>
</presentation:notes>
</draw:page>
<presentation:settings presentation:mouse-visible="false"/>
</office:presentation>
from phppresentation.
@dung1764 Support for notes slide implemented in ODPresentation & PowerPoint2007 Writer. Could you test and give me a feedback ? A sample has been added.
from phppresentation.
@dung1764 It's ok for you ?
from phppresentation.
I can see the xml in the archive but the notes don't seem to show up in ppt (Testing with ppt 2013)
from phppresentation.
I changed the writeNote function of my Slide writer for Powerpoint2007 and this works for me:
public function writeNote(Note $pNote = null)
{
// Check slide
if (is_null($pNote)) {
throw new \Exception("Invalid \PhpOffice\PhpPowerpoint\Slide\Note object passed.");
}
// Create XML writer
$objWriter = $this->getXMLWriter();
// XML header
$objWriter->startDocument('1.0', 'UTF-8', 'yes');
// p:notes
$objWriter->startElement('p:notes');
$objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main');
$objWriter->writeAttribute('xmlns:p', 'http://schemas.openxmlformats.org/presentationml/2006/main');
$objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
// p:cSld
$objWriter->startElement('p:cSld');
// p:spTree
$objWriter->startElement('p:spTree');
// p:nvGrpSpPr
$objWriter->startElement('p:nvGrpSpPr');
// p:cNvPr
$objWriter->startElement('p:cNvPr');
$objWriter->writeAttribute('id', '1');
$objWriter->writeAttribute('name', '');
$objWriter->endElement();
// p:cNvGrpSpPr
$objWriter->writeElement('p:cNvGrpSpPr', null);
// p:nvPr
$objWriter->writeElement('p:nvPr',null);
// ## p:nvGrpSpPr
$objWriter->endElement();
// p:grpSpPr
$objWriter->startElement('p:grpSpPr');
// a:xfrm
$objWriter->startElement('a:xfrm');
// a:off
$objWriter->startElement('a:off');
$objWriter->writeAttribute('x', SharedDrawing::pixelsToEmu($pNote->getOffsetX()));
$objWriter->writeAttribute('y', SharedDrawing::pixelsToEmu($pNote->getOffsetY()));
$objWriter->endElement(); // a:off
// a:ext
$objWriter->startElement('a:ext');
$objWriter->writeAttribute('cx', SharedDrawing::pixelsToEmu($pNote->getExtentX()));
$objWriter->writeAttribute('cy', SharedDrawing::pixelsToEmu($pNote->getExtentY()));
$objWriter->endElement(); // a:ext
// a:chOff
$objWriter->startElement('a:chOff');
$objWriter->writeAttribute('x', SharedDrawing::pixelsToEmu($pNote->getOffsetX()));
$objWriter->writeAttribute('y', SharedDrawing::pixelsToEmu($pNote->getOffsetY()));
$objWriter->endElement(); // a:chOff
// a:chExt
$objWriter->startElement('a:chExt');
$objWriter->writeAttribute('cx', SharedDrawing::pixelsToEmu($pNote->getExtentX()));
$objWriter->writeAttribute('cy', SharedDrawing::pixelsToEmu($pNote->getExtentY()));
$objWriter->endElement(); // a:chExt
// ## a:xfrm
$objWriter->endElement();
// ## p:grpSpPr
$objWriter->endElement();
$objWriter->startElement('p:sp');
$objWriter->startElement('p:nvSpPr');
$objWriter->startElement('p:cNvPr');
$objWriter->writeAttribute('id','1');
$objWriter->writeAttribute('name','Notes Placeholder');
$objWriter->endElement(); //p:cNvPr
$objWriter->startElement('p:cNvSpPr');
$objWriter->startElement('a:spLocks');
$objWriter->writeAttribute('noGrp','1');
$objWriter->endElement();//a:spLocks
$objWriter->endElement(); //p:cNvSpPr
$objWriter->startElement('p:nvPr');
$objWriter->startElement('p:ph');
$objWriter->writeAttribute('type','body');
$objWriter->writeAttribute('idx','1');
$objWriter->endElement(); //p:ph
$objWriter->endElement();//p:nvPr
$objWriter->endElement();//p:nvSpPr
$objWriter->writeElement('p:spPr',null);
$objWriter->startElement('p:txBody');
$objWriter->writeElement('a:bodyPr',null);
$objWriter->writeElement('a:lstStyle',null);
// Loop shapes
$shapes = $pNote->getShapeCollection();
foreach ($shapes as $shape) {
// Check type
if ($shape instanceof RichText) {
$paragraphs = $shape->getParagraphs();
$this->writeParagraphs($objWriter, $paragraphs);
}
}
$objWriter->endElement();//p:txBody
//p:sp
$objWriter->endElement();
//p:spTree
$objWriter->endElement();
//p:cSld
$objWriter->endElement();
// > p:notes
$objWriter->endElement();
// Return
return $objWriter->getData();
}
from phppresentation.
@JewrassicPark @dung1764 If you could test with the last version of the develop branch, and give some feedback (success & fail), I could close or continue this issue. Thanks.
from phppresentation.
Works for me, but to be fair it's the code I already checked so it's not a great test.
from phppresentation.
I finally tested on my Windows Computer with PowerPoint & PowerPoint online and it works. So I close this issue.
from phppresentation.
I've found a case in which it causes powerpoint to crash and it's not
trivial
If you create a first slide without notes then make subsequent slides with
notes, powerpoint can't read the file. I'm currently looking into the bug.
On Thu, Jan 8, 2015 at 7:00 AM, Progi1984 [email protected] wrote:
I finally tested on my Windows Computer with PowerPoint & PowerPoint
online and it works. So I close this issue.—
Reply to this email directly or view it on GitHub
#63 (comment)
.
from phppresentation.
the relationship is either with the _rels directory in notesslides or the
notemaster but I couldn't find the exact relationship
right now I've just patched my project by adding a placeholder note for
slides that don't have notes but this isnt a good solution and should be
opened as a bug
On Thu, Jan 8, 2015 at 1:03 PM, Derek Cohen [email protected] wrote:
I've found a case in which it causes powerpoint to crash and it's not
trivialIf you create a first slide without notes then make subsequent slides with
notes, powerpoint can't read the file. I'm currently looking into the bug.On Thu, Jan 8, 2015 at 7:00 AM, Progi1984 [email protected]
wrote:I finally tested on my Windows Computer with PowerPoint & PowerPoint
online and it works. So I close this issue.—
Reply to this email directly or view it on GitHub
#63 (comment)
.
from phppresentation.
@JewrassicPark Could you open it as a new bug with a sample code ?
from phppresentation.
Related Issues (20)
- It's not working in PHP 8.1
- Issue While Export Data Objects in Pimcore as PPT Format Through PXP Page. HOT 1
- We repaired your presentation. Pie Work but not Bar HOT 1
- Notes in pptx gives error on reader HOT 2
- Can we create a paragraph with rich text?
- Broken layout when save PPTX
- how to save old array value of radio input component?
- Presentations break with version 2309 of PowerPoint HOT 24
- Cannot read .ppt file (PowerPoint97): The feature is not implemented. Please create an issue.
- How to hide empty (value 0%) chartBarClustered ? HOT 2
- Set outline width does not work
- A bug occurs when creating a line chart
- Text missing in PowerPoint, but shows up in Google Slides, LibreOffice Impress
- Error Undefined type 'use\...\'
- The file "" doesn't exist HOT 1
- Problem with instalation: phpoffice/phppresentation 1.0.0 requires phpoffice/phpspreadsheet ^1.9.0
- Data Label Positions not working for Doughnut Chart
- Join two pptx files version 2016 or higher
- Support for Slide Sections
- I would like an option to not load images.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phppresentation.