Find image placed in Powerpoint 16 file's slide.xml file - powerpoint

So I have upzipped a Powerpoint 16 presentation and I am looking at the XML from a slide from the ppt/slides/ directory. I am searching for a reference to the image that is place on this slide, I THINK it is one of the <a:ext uri= references, but if it is I have no clue how to decode that URI into something readable. I just need the name of the image placed in the file. I am currently working on these files as text files mostly from the command line or using BBEdit.
<p:sld xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"><p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Title 1"><a:extLst><a:ext uri="{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"><a16:creationId xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main" id="{B8809CFD-BA0C-B949-842F-AF9DC6782107}"/></a:ext></a:extLst></p:cNvPr><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="title"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="1425631" y="380758"/><a:ext cx="7103533" cy="927452"/></a:xfrm></p:spPr><p:txBody><a:bodyPr><a:noAutofit/></a:bodyPr><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" dirty="0"/><a:t><Module Title></a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="8" name="Rectangle 7" title="keystrokekeystrokekeystroke"><a:extLst><a:ext uri="{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"><a16:creationId xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main" id="{2D7DBD16-C48C-A14E-A06C-D1FA8D4D56EB}"/></a:ext></a:extLst></p:cNvPr><p:cNvSpPr/><p:nvPr/></p:nvSpPr><p:spPr><a:xfrm><a:off x="1153056" y="1471353"/><a:ext cx="6837888" cy="4542163"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr><p:style><a:lnRef idx="2"><a:schemeClr val="accent1"><a:shade val="50000"/></a:schemeClr></a:lnRef><a:fillRef idx="1"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="0"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></p:style><p:txBody><a:bodyPr rtlCol="0" anchor="ctr"/><a:lstStyle/><a:p><a:pPr algn="ctr"/><a:r><a:rPr lang="en-US" dirty="0"/><a:t>Module Open Image</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:nvSpPr><p:cNvPr id="3" name="Shape_27"><a:extLst><a:ext uri="{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"><a16:creationId xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main" id="{29E47EB4-A9BC-C843-A78D-94CF7CDCFA5D}"/></a:ext></a:extLst></p:cNvPr><p:cNvSpPr/><p:nvPr/></p:nvSpPr><p:spPr><a:xfrm><a:off x="1153056" y="1471353"/><a:ext cx="6837888" cy="4542163"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:blipFill><a:blip r:embed="rId2"/><a:stretch><a:fillRect/></a:stretch></a:blipFill></p:spPr><p:style><a:lnRef idx="2"><a:schemeClr val="accent1"><a:shade val="50000"/></a:schemeClr></a:lnRef><a:fillRef idx="1"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="0"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></p:style><p:txBody><a:bodyPr rtlCol="0" anchor="ctr"/><a:lstStyle/><a:p><a:pPr algn="ctr"/><a:endParaRPr lang="en-US"/></a:p></p:txBody></p:sp></p:spTree><p:extLst><p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}"><p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="331219587"/></p:ext></p:extLst></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sld>
So am I close? Is it one of those URI's? If so, how do I decode it? If it is not one of those URI's then were would I find a reference to the slide on the file. I have done the obvious and searched the entire pptx zip file and have not found anything with .jpg in the text that references a file.
I realize this is a lot to ask in a single question, and for that I am sorry. I am just sort of lost at the moment.

For readable XML, look into a text editor like NotePad++, where you can prettify the text into indented lines.
There's no photo on this. There's a title "Module Title", a rectangle colored in Accent 1 with the text "Module Open Image", and another shape, also colored in Accent 1 but without text.
Here's what a slide with a picture looks like:
<p:sld xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main">
<p:cSld>
<p:spTree>
<p:nvGrpSpPr>
<p:cNvPr id="1" name=""/>
<p:cNvGrpSpPr/>
<p:nvPr/>
</p:nvGrpSpPr>
<p:grpSpPr>
<a:xfrm>
<a:off x="0" y="0"/>
<a:ext cx="0" cy="0"/>
<a:chOff x="0" y="0"/>
<a:chExt cx="0" cy="0"/>
</a:xfrm>
</p:grpSpPr>
<p:pic>
<p:nvPicPr>
<p:cNvPr id="5" name="Picture 4">
<a:extLst>
<a:ext uri="{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}">
<a16:creationId xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main" id="{0966E3E9-FCFA-4DDB-B218-46F441B47F87}"/>
</a:ext>
</a:extLst>
</p:cNvPr>
<p:cNvPicPr>
<a:picLocks noChangeAspect="1"/>
</p:cNvPicPr>
<p:nvPr/>
</p:nvPicPr>
<p:blipFill>
<a:blip r:embed="rId2"/>
<a:stretch>
<a:fillRect/>
</a:stretch>
</p:blipFill>
<p:spPr>
<a:xfrm>
<a:off x="4388972" y="1200719"/>
<a:ext cx="3414056" cy="4456562"/>
</a:xfrm>
<a:prstGeom prst="rect">
<a:avLst/>
</a:prstGeom>
</p:spPr>
</p:pic>
</p:spTree>
<p:extLst>
<p:ext uri="{BB962C8B-B14F-4D97-AF65-F5344CB8AC3E}">
<p14:creationId xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="2510507612"/>
</p:ext>
</p:extLst>
</p:cSld>
<p:clrMapOvr>
<a:masterClrMapping/>
</p:clrMapOvr>
</p:sld>
The picture is not stored in the slide, it is only referenced. <a:blip r:embed="rId2"/> is the reference. Embedded photos are renamed and stored in the media folder. To find its format, you would check the slideX.xml.rels file (where X is the same slide number as the one you're checking) for rId2 to find that it is called image1.png inside the file.

Related

How to handle image not found exception in report? [duplicate]

This question already has answers here:
How to handle "Byte data not found"
(4 answers)
Hide image when its value is NULL or Empty in JasperReports
(2 answers)
How to show an image on jasper report?
(4 answers)
Closed 1 year ago.
I need to show an image in my report. It's showing correctly when the image is present in the path given in my image tag. But sometimes the image may not available in the location. In that case i'm getting image not found exception, instead i need to print blank.
My code to add image is
<image scaleImage="FillFrame" vAlign="Top" hAlign="Left" isUsingCache="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
mode="Opaque"
x="18"
y="30"
width="125"
height="25"
forecolor="#000000"
backcolor="#FFFFFF"
key="image-1"
stretchType="NoStretch"
positionType="FixRelativeToTop"
isPrintRepeatedValues="true"
isRemoveLineWhenBlank="true"
isPrintInFirstWholeBand="false"
isPrintWhenDetailOverflows="false">
<printWhenExpression><![CDATA[new Boolean(!$P{signImagePath}.equals(""))]]></printWhenExpression>
</reportElement>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#FFFFFF" bottomBorder="None" bottomBorderColor="#000000"/>
<graphicElement stretchType="NoStretch" pen="None" fill="Solid" />
<imageExpression class="java.lang.String"><![CDATA[$P{signImagePath}+$F{USER_CODE}+".jpg"]]></imageExpression>

Print Barcode type as 'code128' not scanning in odoo

I have created a Product Code with some criteria..
My Barcode lenth is around 26-30 characters..
I can print barcode properly but when scan/ read it not getting value..
My BarCode:
47789456789234/100001|417-19D
print_barcode.xml
<img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' %
('Code128', l.lot_id.name, 600, 100)"
style="width:300px;height:50px;" />
Can anyone help me to resolve this.
Try changing the Barcode format to EAN13 from Code128.
<img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' %('EAN13', l.lot_id.name, 600, 100)" style="width:300px;height:50px;" />

Not able to see base64 image in PDF using xslfo and FOP 2.1

I have a use case where I have to show an dynamic image on pdf. I am using FApacheFOP 2.1 of PDF generation. I am getting the image row at a from an API call then I am converting that image to base 64 format.
please find the java coe to convert image:
String jpgFileName = ConfigManager.getImageFilePath() + "/jpgImage-"+System.currentTimeMillis()+".jpg";
Blob imageDataBlob = (Blob) faesRow.get("imageData");
FileUtil.writeToFile(imageDataBlob, jpgFileName);
String base64Result = Base64.getEncoder().encodeToString(FileUtil.readFromFile(jpgFileName).getBytes("utf-8"));
result = base64Result;
I am using base64 type data in xslfo to print the image on PDF, Please find the xslfo below, here $!signatureImage is the data sent by the java code above:
<xsl:param name="Name">data:image/jpg;base64,{$!signatureImage}</xsl:param>
<fo:block-container absolute-position="absolute" left="3.50in" top="9.25in" width="4.0in" height="2.0in">
<fo:block text-align="left">
<fo:external-graphic content-width="scale-to-fit"
content-height="100%"
width="100%"
scaling="uniform"
src="url({$Name})"/>
</fo:block>
</fo:block-container>
In the output of template rendering I ma getting base64 stream there in the xslfo file. Please find the output below:
<xsl:param name="Name">data:image/jpg;base64,{77+977+977+977+9ABBK... }</xsl:param>
<fo:block-container absolute-position="absolute" left="3.50in" top="9.25in" width="4.0in" height="2.0in">
<fo:block text-align="left">
<fo:external-graphic content-width="scale-to-fit"
content-height="100%"
width="100%"
scaling="uniform"
src="url({$Name})"/>
</fo:block>
</fo:block-container>
Now the problem is that image is not getting priced at PDF output generated. Can you please help me to find out a way to print Image here.
Extra Information:
1. I am not getting any error to generate PDF.
2. PDF is able to print static images and barcode.
I found out the problem in that case.
first issue was with base64 conversion, we need to use conversion as below:
File file= new File(jpgFileName);
FileInputStream fileInputStream= new FileInputStream(file);
byte[] b= new byte[(int) file.length()];
fileInputStream.read(b);
String base64Result = new String(Base64.getEncoder().encode(b),"UTF-8");
Other than this some change is also required in xslfo template too, Please find the change below:
<fo:block-container absolute-position="absolute" left="3.50in" top="9.25in" width="4.0in" height="2.0in">
<fo:block text-align="left">
<fo:external-graphic content-width="scale-to-fit"
content-height="100%"
width="100%"
scaling="uniform"
src="url('data:image/jpeg;base64,$!signatureImage')"/>
</fo:block>
</fo:block-container>

Why is my BottomAppBar no longer displaying?

My BottomAppBar was displaying previously. I haven't changed the XAML, which is, in MainPage.xaml:
<Page.BottomAppBar>
<AppBar x:Name="bottomAppBar" Padding="10,0,10,0">
<CommandBar>
<CommandBar.SecondaryCommands>
<AppBarButton Icon="BrowsePhotos" Label="Browse" AutomationProperties.Name="Browse Photos" Click="btnOpenImgFiles_Click"/>
</CommandBar.SecondaryCommands>
<CommandBar.PrimaryCommands>
<AppBarButton Icon="OpenFile" Label="Open" AutomationProperties.Name="Open File" Click="btnOpenMap_Click"/>
<AppBarButton Icon="Save" Label="Save" AutomationProperties.Name="Save File" Click="btnSaveMap_Click"/>
</CommandBar.PrimaryCommands>
</CommandBar>
</AppBar>
</Page.BottomAppBar>
While running my (at present very minimalistic) app via F5, I can get the BottomAppBar to display via Windows Key + Z, but it is blank now - just a black strip. What could have happened?
You shouldn't put an app bar in an app bar. This is what you should have:
<Page.BottomAppBar>
<CommandBar x:Name="bottomAppBar">
<CommandBar.SecondaryCommands>
<AppBarButton Icon="BrowsePhotos" Label="Browse" AutomationProperties.Name="Browse Photos" Click="btnOpenImgFiles_Click"/>
</CommandBar.SecondaryCommands>
<CommandBar.PrimaryCommands>
<AppBarButton Icon="OpenFile" Label="Open" AutomationProperties.Name="Open File" Click="btnOpenMap_Click"/>
<AppBarButton Icon="Save" Label="Save" AutomationProperties.Name="Save File" Click="btnSaveMap_Click"/>
</CommandBar.PrimaryCommands>
</CommandBar>
</Page.BottomAppBar>
If you really feel strongly about the padding then put it as margins on the buttons instead of nesting app bars.

displaying a picture from a folder using a product name as a variable in actionscript

Hi I have a popup that displays a product details and I would like to display a picture from a folder which is named same as the product - so for example:
...
imageName = "pca" + this._product.productID;
...
My question is how can I display an image using imageName + .jpeg
Doing this works but I need to be able to substitute the image name by a variable - dynamically:
<mx:Image name="testImg" width="100%" height="100%" source="file:///C|/MultimediaSync/pictures/pca98694E000.jpg">
</mx:Image>
What I want to do instead is something like this but it doesn't work:
<mx:Image name="testImg" width="100%" height="100%" source="file:///C|/MultimediaSync/pictures/&imageName">
</mx:Image>
I am stuck on the syntaxt do this here...might be a simple one but I am a novice to as3/Flex
First define a class binding the image you need. Then the bitmap of the image can be retrieved, encoded (using an encoder) and assigned to the source property of mx.controls.Image instance.
After the formation of the image, it can be added to a canvas as a child. Alternatively, it should work if the source attribute is bound to the encoded data obtained from the class instance. I had the same problem and first solution worked for me. Following is my reference.
http://shyarmal.blogspot.com/2012/12/flex-displayable-image-from-image.html
Mark your imageName as Bindable:
[Bindable]
private var imageName:String;
and then use curly brackets{} in the source:
<mx:Image name="testImg" width="100%" height="100%"
source="file:///C|/MultimediaSync/pictures/{imageName}">
</mx:Image>
Whenever you will change imageName variable, the source will be updated respectively.
If Your Variable have Full Path Of Image, then You have To assign a Id to Image Like
<mx:Image **id="testImage"** name="testImg" width="100%" height="100%" source="file:///C|/MultimediaSync/pictures/&imageName">
</mx:Image>
[1] You can Assign A Image Like
testImage.Source=imageName;
and call every time when your imageName variable chagen.
[2] make sure your variable must be a [Binadable].
as per Above answer.
Hope Your Problem'll be solved...

Resources