Learning & Integrating web technology and code help directory

How to use PHP & PowerPoint - Font Style

No comments
How to use PHP & PowerPoint - Font Style The Learn / Tutorial / Sctipts php programming how to using  PHP Create PowerPoint and Font/Style
ShotDev Focus:
- PHP  & Create PowerPoint and Font/Style
Example
php_ppt_style.php
  1. <html>  
  2. <head>  
  3. <title>ShotDev.Com Tutorial</title>  
  4. </head>  
  5. <body>  
  6. <?  
  7.   
  8. //*** Constant ***//  
  9. $ppLayoutBlank = 12;  
  10. $ppLayoutChart = 8;  
  11. $ppLayoutChartAndText = 6;  
  12. $ppLayoutClipartAndText = 10;  
  13. $ppLayoutClipArtAndVerticalText = 26;  
  14. $ppLayoutFourObjects = 24;  
  15. $ppLayoutLargeObject = 15;  
  16. $ppLayoutMediaClipAndText = 18;  
  17. $ppLayoutMixed = -2;  
  18. $ppLayoutObject = 16;  
  19. $ppLayoutObjectAndText = 14;  
  20. $ppLayoutObjectAndTwoObjects = 30;  
  21. $ppLayoutObjectOverText = 19;  
  22. $ppLayoutOrgchart = 7;  
  23. $ppLayoutTable = 4;  
  24. $ppLayoutText = 2;  
  25. $ppLayoutTextAndChart = 5;  
  26. $ppLayoutTextAndClipart = 9;  
  27. $ppLayoutTextAndMediaClip = 17;  
  28. $ppLayoutTextAndObject = 13;  
  29. $ppLayoutTextAndTwoObjects = 21;  
  30. $ppLayoutTextOverObject = 20;  
  31. $ppLayoutTitle = 1;  
  32. $ppLayoutTitleOnly = 11;  
  33. $ppLayoutTwoColumnText = 3;  
  34. $ppLayoutTwoObjects = 29;  
  35. $ppLayoutTwoObjectsAndObject = 31;  
  36. $ppLayoutTwoObjectsAndText = 22;  
  37. $ppLayoutTwoObjectsOverText = 23;  
  38. $ppLayoutVerticalText = 25;  
  39. $ppLayoutVerticalTitleAndText = 27;  
  40. $ppLayoutVerticalTitleAndTextOverChart = 28;  
  41.   
  42. //*** Font Color ***//  
  43. $wdColorLightGreen  = "&HCCFFCC";  
  44. $wdColorBlue = "&HFF0000";  
  45.   
  46. $ppApp = new COM("PowerPoint.Application");  
  47.   
  48. $strPath = realpath(basename(getenv($_SERVER["SCRIPT_NAME"]))); // C:/AppServ/www/myphp  
  49. $ppName = "MyPP/MyPPt.ppt";  
  50.   
  51. $ppPres = $ppApp->Presentations->Add();  
  52.   
  53. $ppSlide1 = $ppPres->Slides->Add(1,$ppLayoutTitleOnly);  
  54. //*** AddTextbox, objControl.Left,objControl.Top,objControl.Width,objControl.Height ***//  
  55. $ppSlide1->Shapes->AddTextbox(1,50,100,700,100);  //***4  
  56. $ppSlide1->Shapes(1)->TextFrame->TextRange->Text = "I Love ShotDev.Com 1";  
  57. $ppSlide1->Shapes(1)->TextFrame->TextRange->Font->Name = "Arial";  
  58. $ppSlide1->Shapes(1)->TextFrame->TextRange->Font->Size = 10;  
  59. $ppSlide1->Shapes(1)->TextFrame->TextRange->Font->Color  = $wdColorLightGreen;  
  60.   
  61. $ppSlide1->Shapes->AddTextbox(1,50,150,700,100);  
  62. $ppSlide1->Shapes(2)->TextFrame->TextRange->Text = "I Love ShotDev.Com 2";  
  63. $ppSlide1->Shapes(2)->TextFrame->TextRange->Font->Name = "Arial";  
  64. $ppSlide1->Shapes(2)->TextFrame->TextRange->Font->Size = 20;  
  65.   
  66. $ppSlide1->Shapes->AddTextbox(1,50,200,700,100);  
  67. $ppSlide1->Shapes(3)->TextFrame->TextRange->Text = "I Love ShotDev.Com 3";  
  68. $ppSlide1->Shapes(3)->TextFrame->TextRange->Font->Name = "Arial";  
  69. $ppSlide1->Shapes(3)->TextFrame->TextRange->Font->Size = 30;  
  70.   
  71. $ppSlide1->Shapes->AddTextbox(1,50,250,700,100);  
  72. $ppSlide1->Shapes(4)->TextFrame->TextRange->Text = "I Love ShotDev.Com 4";  
  73. $ppSlide1->Shapes(4)->TextFrame->TextRange->Font->Name = "Arial";  
  74. $ppSlide1->Shapes(4)->TextFrame->TextRange->Font->Size = 40;  
  75.   
  76. $ppSlide1->Shapes->AddTextbox(1,50,300,700,100);  
  77. $ppSlide1->Shapes(5)->TextFrame->TextRange->Text = "I Love ShotDev.Com 5";  
  78. $ppSlide1->Shapes(5)->TextFrame->TextRange->Font->Name = "Arial";  
  79. $ppSlide1->Shapes(5)->TextFrame->TextRange->Font->Size = 50;  
  80. $ppSlide1->Shapes(5)->TextFrame->TextRange->Font->Color  = $wdColorBlue;  
  81.   
  82. $ppApp->Presentations[1]->SaveAs($strPath."/".$ppName);  
  83. //$ppApp->Presentations[1]->SaveAs(realpath($ppName));  
  84.   
  85. $ppApp->Quit;  
  86. $ppApp = null;  
  87.   
  88. //*** Font Color ***//  
  89. //$Const wdColorAqua = "&HCCCC33";  
  90. //$Const wdColorAutomatic = "&HFF000000";  
  91. //$Const wdColorBlack = "&H0";  
  92. //$Const wdColorBlue = "&HFF0000";  
  93. //$Const wdColorBlueGray = "&H996666";  
  94. //$Const wdColorBrightGreen = "&HFF00";  
  95. //$Const wdColorBrown = "&H3399";  
  96. //$Const wdColorDarkBlue = "&H800000";  
  97. //$Const wdColorDarkGreen = "&H3300";  
  98. //$Const wdColorDarkRed = "&H80";  
  99. //$Const wdColorDarkTeal = "&H663300";  
  100. //$Const wdColorDarkYellow = "&H8080";  
  101. //$Const wdColorGold = "&HCCFF";  
  102. //$Const wdColorGray05 = "&HF3F3F3";  
  103. //$Const wdColorGray10 = "&HE6E6E6";  
  104. //$Const wdColorGray125 = "&HE0E0E0";  
  105. //$Const wdColorGray15 = "&HD9D9D9";  
  106. //$Const wdColorGray20 = "&HCCCCCC";  
  107. //$Const wdColorGray25 = "&HC0C0C0";  
  108. //$Const wdColorGray30 = "&HB3B3B3";  
  109. //$Const wdColorGray35 = "&HA6A6A6";  
  110. //$Const wdColorGray375 = "&HA0A0A0";  
  111. //$Const wdColorGray40 = "&H999999";  
  112. //$Const wdColorGray45 = "&H8C8C8C";  
  113. //$Const wdColorGray50 = "&H808080";  
  114. //$Const wdColorGray55 = "&H737373";  
  115. //$Const wdColorGray60 = "&H666666";  
  116. //$Const wdColorGray625 = "&H606060";  
  117. //$Const wdColorGray65 = "&H595959";  
  118. //$Const wdColorGray70 = "&H4C4C4C";  
  119. //$Const wdColorGray75 = "&H404040";  
  120. //$Const wdColorGray80 = "&H333333";  
  121. //$Const wdColorGray85 = "&H262626";  
  122. //$Const wdColorGray875 = "&H202020";  
  123. //$Const wdColorGray90 = "&H191919";  
  124. //$Const wdColorGray95 = "&HC0C0C";  
  125. //$Const wdColorGreen = "&H8000";  
  126. //$Const wdColorIndigo = "&H993333";  
  127. //$Const wdColorLavender = "&HFF99CC";  
  128. //$Const wdColorLightBlue = "&HFF6633";  
  129. //$Const wdColorLightGreen = "&HCCFFCC";  
  130. //$Const wdColorLightOrange = "&H99FF";  
  131. //$Const wdColorLightTurquoise = "&HFFFFCC";  
  132. //$Const wdColorLightYellow = "&H99FFFF";  
  133. //$Const wdColorLime = "&HCC99";  
  134. //$Const wdColorOliveGreen = "&H3333";  
  135. //$Const wdColorOrange = "&H66FF";  
  136. //$Const wdColorPaleBlue = "&HFFCC99";  
  137. //$Const wdColorPink = "&HFF00FF";  
  138. //$Const wdColorPlum = "&H663399";  
  139. //$Const wdColorRed = "&HFF";  
  140. //$Const wdColorRose = "&HCC99FF";  
  141. //$Const wdColorSeaGreen = "&H669933";  
  142. //$Const wdColorSkyBlue = "&HFFCC00";  
  143. //$Const wdColorTan = "&H99CCFF";  
  144. //$Const wdColorTeal = "&H808000";  
  145. //$Const wdColorTurquoise = "&HFFFF00";  
  146. //$Const wdColorViolet = "&H800080";  
  147. //$Const wdColorWhite = "&HFFFFFF";  
  148. //$Const wdColorYellow = "&HFFFF";  
  149.   
  150. ?>  
  151. PowerPoint Created <a href="<?=$ppName?>">Click here</a> to Download.  
  152. </body>  
  153. </html>  
Create a php file and save to path root-path/myphp/
Screenshot
PHP & PowerPoint - Create PowerPoint and Font/Style
.
.

No comments :

Post a Comment