create a new page, using OOoBasic/Writer/TextGraphic as a template.
Front page
Search
掲示板
Reload
Help
Browse Log
掲示板の使い方
OOo 掲示板3
OOo 掲示板2
OOo 掲示板
掲示板
雑談掲示板
New
List of pages
Recent changes
Backup
簡単ヘルプ
整形ルール
Start:
*画像の挿入 [#s0f408aa]
Writer では com.sun.star.text.TextGraphicObject を利用し...
#contents
**リンクとして挿入 [#j7641543]
この方法ではリンクになります。
#code(ob){{
Sub textgraphic_1
oDoc = ThisComponent
oText = oDoc.getText()
oViewCursor = oDoc.getCurrentController().getViewCurso...
Dim aSize As New com.sun.star.awt.Size
aSize.Width = 1000
aSize.Height = 1000
oGraphic = oDoc.createInstance("com.sun.star.text.Text...
oGraphic.GraphicURL = "file:///C:/usr/current_16.png"
oGraphic.Size = aSize
oText.insertTextContent(oViewCursor,oGraphic,False)
End Sub
}}
**埋め込みとして挿入 [#ic77f8ed]
リンクとしてではなく埋め込み画像としてドキュメントに同梱...
#code(ob){{
Sub insertTextGraphic_2
oDoc = ThisComponent
oText = oDoc.getText()
oGP = CreateUnoService("com.sun.star.graphic.GraphicPro...
Dim aArgs(0) As New com.sun.star.beans.PropertyValue
sGraphicURL = "file:///C:/usr/img.png"
aArgs(0).Name = "URL"
aArgs(0).Value = sGraphicURL
oGraphic = oGP.queryGraphic(aArgs)
oTextGraphic = oDoc.createInstance( _
"com.sun.star.text.TextGraphicObject")
oTextGraphic.Graphic = oGraphic
aSize = oGraphic.Size
aSize.Width = CLng((aSize.Width / 96.0) * 2540.0)
aSize.Height = CLng((aSize.Height / 96.0) * 2540.0)
oTextGraphic.setSize(aSize)
oText.insertTextContent(oText.getEnd(),oTextGraphic,Fal...
End Sub
}}
**画像のページ移動 [#n3abea38]
ページにアンカーされているページを移動させます。
#code(ob){{
Sub GraphicToNextPage
oDoc = ThisComponent
oGraphics = oDoc.getGraphicObjects()
For i = 0 To oGraphics.getCount() -1 step 1
oGraphic = oGraphics.getByIndex(i)
If oGraphic.AnchorType = com.sun.star.text.TextConten...
nPage = oGraphic.AnchorPageNo
oGraphic.AnchorPageNo = nPage + 1
End If
Next
End Sub
}}
** 文字として挿入 [#bea53319]
Sub textgraphic_11
oDoc = ThisComponent
oText = oDoc.getText()
oViewCursor = oDoc.getCurrentController().getViewCurso...
Dim aSize As New com.sun.star.awt.Size
aSize.Width = 1000
aSize.Height = 1000
oGraphic = oDoc.createInstance("com.sun.star.text.Text...
oGraphic.GraphicURL = "file:///home/asuka/Documents/im...
oGraphic.Size = aSize
oGraphic.AnchorType = com.sun.star.text.TextContentAnc...
oText.insertTextContent(oViewCursor,oGraphic,False)
End Sub
End:
*画像の挿入 [#s0f408aa]
Writer では com.sun.star.text.TextGraphicObject を利用し...
#contents
**リンクとして挿入 [#j7641543]
この方法ではリンクになります。
#code(ob){{
Sub textgraphic_1
oDoc = ThisComponent
oText = oDoc.getText()
oViewCursor = oDoc.getCurrentController().getViewCurso...
Dim aSize As New com.sun.star.awt.Size
aSize.Width = 1000
aSize.Height = 1000
oGraphic = oDoc.createInstance("com.sun.star.text.Text...
oGraphic.GraphicURL = "file:///C:/usr/current_16.png"
oGraphic.Size = aSize
oText.insertTextContent(oViewCursor,oGraphic,False)
End Sub
}}
**埋め込みとして挿入 [#ic77f8ed]
リンクとしてではなく埋め込み画像としてドキュメントに同梱...
#code(ob){{
Sub insertTextGraphic_2
oDoc = ThisComponent
oText = oDoc.getText()
oGP = CreateUnoService("com.sun.star.graphic.GraphicPro...
Dim aArgs(0) As New com.sun.star.beans.PropertyValue
sGraphicURL = "file:///C:/usr/img.png"
aArgs(0).Name = "URL"
aArgs(0).Value = sGraphicURL
oGraphic = oGP.queryGraphic(aArgs)
oTextGraphic = oDoc.createInstance( _
"com.sun.star.text.TextGraphicObject")
oTextGraphic.Graphic = oGraphic
aSize = oGraphic.Size
aSize.Width = CLng((aSize.Width / 96.0) * 2540.0)
aSize.Height = CLng((aSize.Height / 96.0) * 2540.0)
oTextGraphic.setSize(aSize)
oText.insertTextContent(oText.getEnd(),oTextGraphic,Fal...
End Sub
}}
**画像のページ移動 [#n3abea38]
ページにアンカーされているページを移動させます。
#code(ob){{
Sub GraphicToNextPage
oDoc = ThisComponent
oGraphics = oDoc.getGraphicObjects()
For i = 0 To oGraphics.getCount() -1 step 1
oGraphic = oGraphics.getByIndex(i)
If oGraphic.AnchorType = com.sun.star.text.TextConten...
nPage = oGraphic.AnchorPageNo
oGraphic.AnchorPageNo = nPage + 1
End If
Next
End Sub
}}
** 文字として挿入 [#bea53319]
Sub textgraphic_11
oDoc = ThisComponent
oText = oDoc.getText()
oViewCursor = oDoc.getCurrentController().getViewCurso...
Dim aSize As New com.sun.star.awt.Size
aSize.Width = 1000
aSize.Height = 1000
oGraphic = oDoc.createInstance("com.sun.star.text.Text...
oGraphic.GraphicURL = "file:///home/asuka/Documents/im...
oGraphic.Size = aSize
oGraphic.AnchorType = com.sun.star.text.TextContentAnc...
oText.insertTextContent(oViewCursor,oGraphic,False)
End Sub
Page: