|
I am using Visual Studio 2008 Visual C++ non-mfc. Using dynamic DLL loading in my test application. I have tested simple sample codes using DPLDrawDataMatrixSymbol, DPLDrawText, DPLSetLineColor, pDPLDrawRotatedBox, etcs without issue. Generated PDF opens as expected. However, when I start using DPLCreateTable function (convert from Page Layout - Create a Table Sample), Adobe Reader cannot open the generated PDF file and reported error 110 !
Am I missing on some setup codes to configure the Table ??? Below is my partial source code : ..... .... typedef int (__stdcall *pFunctionAddress08)(int, int, int); pFunctionAddress08 pDPLCreateTable; .... typedef int (__stdcall *pFunctionAddress12)(int, int, int, int, double); pFunctionAddress12 pDPLSetTableRowHeight; pFunctionAddress12 pDPLSetTableColumnWidth ....
.... ....LoadLibrary(..... //********************************************// // Convert from Page Layout - Create a Table Sample // //********************************************// bool CreatePDFTable(void) { int result; // CreateLibrary InstanceID=pDPLCreateLibrary(); if (!InstanceID) return false; // Unlock library result=pDPLUnlockKey(InstanceID,"xxxxxxxxxxxxxxxxx"); if (!result) return false; result = pDPLSetPageSize(InstanceID, "Letter"); if (!result) return false; tableID = pDPLCreateTable(InstanceID, 5, 5); // Specify color and width of borders result = pDPLSetTableBorderColor(InstanceID, tableID, 0, 0.3, 0.204, 0); result = pDPLSetTableBorderWidth(InstanceID, tableID, 0, 0.2); // Specify table row height and table column width result = pDPLSetTableRowHeight(InstanceID, tableID, 1, 5, 0); result = pDPLSetTableColumnWidth(InstanceID, tableID, 1, 5, 100); // Specify a background color for the column headers result = pDPLSetTableCellBackgroundColor(InstanceID, tableID, 1, 1, 1, 5, 0.3, 0.7, 1.0); result = pDPLSetTableCellAlignment(InstanceID, tableID, 1, 1, 1, 5, 4); // Setup the column headers and content for the first row result = pDPLSetTableCellContent(InstanceID, tableID, 1, 1, "<b>This Week</b>"); result = pDPLSetTableCellContent(InstanceID, tableID, 1, 2, "<b>Last Week</b>"); result = pDPLSetTableCellContent(InstanceID, tableID, 1, 3, "<b>Artist Name</b>"); result = pDPLSetTableCellContent(InstanceID, tableID, 1, 4, "<b>Peak</b>"); result = pDPLSetTableCellContent(InstanceID, tableID, 1, 5, "<b>Weeks On</b>"); // Insert the content for the second row result = pDPLSetTableCellContent(InstanceID, tableID, 2, 1, "1"); result = pDPLSetTableCellContent(InstanceID, tableID, 2, 2, "1"); result = pDPLSetTableCellContent(InstanceID, tableID, 2, 3, "<b>The Black Eyed Peas</b><br>Boom Boom Pow"); result = pDPLSetTableCellContent(InstanceID, tableID, 2, 4, "<b>1</b>"); result = pDPLSetTableCellContent(InstanceID, tableID, 2, 5, "<b>11</b>"); // Insert the content for the third row result = pDPLSetTableCellContent(InstanceID, tableID, 3, 1, "2"); result = pDPLSetTableCellContent(InstanceID, tableID, 3, 2, "3"); result = pDPLSetTableCellContent(InstanceID, tableID, 3, 3, "<b>Missy Higgins</b><br>Life is a rainbow"); result = pDPLSetTableCellContent(InstanceID, tableID, 3, 4, "<b>2</b>"); result = pDPLSetTableCellContent(InstanceID, tableID, 3, 5, "<b>8</b>"); // Insert the content for the fourth row result = pDPLSetTableCellContent(InstanceID, tableID, 4, 1, "3"); result = pDPLSetTableCellContent(InstanceID, tableID, 4, 2, "2"); result = pDPLSetTableCellContent(InstanceID, tableID, 4, 3, "<b>Silverchair</b><br>The Door"); result = pDPLSetTableCellContent(InstanceID, tableID, 4, 4, "<b>3</b>"); result = pDPLSetTableCellContent(InstanceID, tableID, 4, 5, "<b>7</b>"); // Insert the content for the fourth row result = pDPLSetTableCellContent(InstanceID, tableID, 5, 1, "4"); result = pDPLSetTableCellContent(InstanceID, tableID, 5, 2, "4"); result = pDPLSetTableCellContent(InstanceID, tableID, 5, 3, "<b>Rolling Stones</b><br>Sweet Virginia"); result = pDPLSetTableCellContent(InstanceID, tableID, 5, 4, "<b>4</b>"); result = pDPLSetTableCellContent(InstanceID, tableID, 5, 5, "<b>19</b>"); // Draw the table onto the document result = pDPLSetOrigin(InstanceID, 1); if (!result) return false; result = pDPLDrawTableRows(InstanceID, tableID, 50, 50, 400, 1, 0); result=pDPLSaveToFile(InstanceID,"HelloFromDLL.pdf"); if (!result) return false; // Release Library result = pDPLReleaseLibrary(InstanceID); if (!result) return false; return true; } Please advise. Thanks in advance. Best regards Trial User
|