You create an empty PDEContent and add some text. You don't assign this to a page.
Look for 'Inserting Text into PDF Documents' in the document 'Developing Plug-ins and Applications'.
I don't know.. inserting text into...Thank you for your help, Bernd Alheit
I read the?'Inserting Text into PDF Documents' in the document 'Developing Plug-ins and Applications' and
I add this code. compiling is good. but it is not work againg.
here's my added code
please help me again.
I still do not know why it does not work.
I saw a lot of the documentation for the code to find.
But to me, is the limit.
-------------------------------------------------------------------------------- --------
static ACCB1 void ACCB2 addTextCommand (void *data)
{
PDDoc pdDoc ;
pdDoc = PDDocCreate();
PDPage pdPage;
ASFixedRect mediaBox;
//Set the page size
mediaBox.left = fixedZero;
mediaBox.top = Int16ToFixed(4*72);
mediaBox.right = Int16ToFixed(5*72);
mediaBox.bottom = fixedZero;
//Create a page and insert it as the first page
pdPage = PDDocCreatePage(pdDoc, PDBeforeFirstPage, mediaBox);
// Create a PDEText object
PDEText pdeText = PDETextCreate();
pdeContent = PDPageAcquirePDEContent(pdPage, NULL);
.
.
.
-------------------------------------------------------------------------------- --------
Where did you use the PDPageSetPDEContent method?
Thank you, Thank you, Thank you, very much
You are very kind.
I use PDPageSetPDEContent method there (under the codes)
I did use the wrong?
and my plug in's mission is
''Blank page or any other page and the text will enter the touch of a button''
but i push the button , it is no reaction
sorry, I am newbie in SDK
thank you very much for your teachings are
-------------------------------------------------------------------------------
.
.
.
.
// Create an ASFixedMatrix object
memset(%26amp;textMatrix, 0, sizeof(textMatrix));
textMatrix.a = Int16ToFixed(24);
textMatrix.d = Int16ToFixed(24);
textMatrix.h = Int16ToFixed(1*72);
textMatrix.v = Int16ToFixed(2*72);
//Create a PDEText Object
pdeText =?PDETextCreate();
PDETextAdd (pdeText, kPDETextRun, 0,(ASUns8 *)Title, 30, pdeFont, %26amp;gState,
sizeof(gState), NULL, 0, %26amp;textMatrix, NULL);
PDEContentAddElem(pdeContent, kPDEAfterLast, (PDEElement) pdeText);
b = PDPageSetPDEContent(pdPage, NULL); %26lt;--- PDPageSetPDEContent method
}
-------------------------------------------------------------------------------
For PDPageAcquirePDEContent and PDPageSetPDEContent you must use the parameter gExtensionID.
thank you very much Alheit :)
i fixed that
but it does not work.
compiling is ok.
This is full code of the command button.
Looks do not matter nowAlso does not run.
've Read the documentation I do not know what the problem is.
The line
pdDoc = PDDocCreate();
creates a virtual pddoc.
When you want add text to the current document use following lines:
avDoc = AVAppGetActiveDoc( );
pdDoc = AVDocGetPDDoc(avDoc);
The problem is resolved!
No comments:
Post a Comment