Jump to content

misc_bb

Members
  • Content Count

    65
  • Joined

  • Last visited

Everything posted by misc_bb

  1. Currently working on generating a docx file with an SVG image insertion. I have followed along this blog utilizing OpenXML byBruno Sonnino. I notice that if the image are non-svg (jpg, png, etc) they are embedded as is but if you insert SVG image it will create a second file that is in .png format. This part is somehow tricky for me. Not sure how to it can be done. Has anyone tried this before? When is the process generating .png happen? Thanks!
  2. misc_bb

    Working with SVG in OpenXML SDK in Delphi

    I haven't tried the integrity check of the XML file although I do check/compare them in VC with those generated by Word itself but I'll try your suggestions. Thanks! 🙂
  3. misc_bb

    Working with SVG in OpenXML SDK in Delphi

    I've been working with Delphi and OOXML for a few weeks now and although its a bit tedious setting everything but generating simple documents is becoming handy. This has been my starting guide: https://blogs.msmvps.com/bsonnino/2021/05/15/creating-openxml-files-with-delphi/?unapproved=5149&moderation-hash=435cc9a4d4ae1108be452c23b773f04f#comment-5149 Thanks to Sir Bruno! The only problem I cannot figure out is this prompt when opening the docx file generated from Delphi, see attached image. I'm not exactly sure if I can get rid of it but I would like to know if anyone else working with OOXML in Delphi if you have encountered the same?
  4. We are currently dealing with rendering SVG images dynamically and we want to render the SVG using the svg code. Reading the svg code from a text file causing some text to be converted to something. What's the best approach for this one? Convert to UTF-8? Currently trying to create using a TMemoryStream then save the stream to a file via ImageEN but svg text/code gets converted to ascii.
  5. yes, I think I'm on that direction now as I continue testing and working out a solution. Thanks @angusj Got it figure out now! Thanks everyone!
  6. @angusj Not really my intention to bypass. But basically we just want to create the svg file directly using the svg code. In the processing context, I'm not sure exactly if it bypasses the rendering process. I hope I am making sense now 🙂 I was happy working with Image32 but boss wants me to use ImageEN because he purchased it
  7. Since SVG is composed of XML, I also tried using XMLdocument but loading the content of the file already gave me errors probably because of text layers? (but i still test it again). So basically reading the file or encoding it probably hopefully is the way to go.
  8. @angusj Thank you so much! The font manager works like a charm!
  9. Thanks Angus, I was actually considering this documentation from the site: http://www.angusj.com/delphi/image32/Docs/Units/Img32.Fmt.SVG/_Body.htm then I realized this was only a mere change of format maybe that's why the text layers were not considered. And when I applied the SVG101 for the same svg file it did show the text layers. Although they are a bit messed up due to the font styles but that's another story. How about without going through an ImagePanel will it still work? I'm seeing an error when I tried just declaring/creating ImagePanel on the fly without the actual component in the form. The error comes in during the LoadFromFile.
  10. @angusj I've tried converting SVG to PNG, are text layers not included during conversion or I maybe missing something? I just followed the example code. Thank you.
  11. misc_bb

    Could not load OpenSSL library.

    Just encountered the same problem here. I have a working ISAPI / IIS config with Winserver 2012 r2 but running a new setup now. Running an ISAPI 64bit application under a new Windows 2019 server. Placed the DLLs in the same folder as the app but still can't load it. @Yaron May I know which version of the DLLs did you used? Update: placing in DLLs in SysWow64 seems to work
  12. I'm currently exploring the DelphiMVCFramework and I did created a simple project using the default configuration and the executable works fine locally. But when I tried to convert the same to an ISAPI dll and deploy it in ISS I get an exception: HTTP 404 [EMVCException] Not Found anyone encountered this issue? I found similar issue at Danielis FB Page: https://www.facebook.com/groups/delphimvcframework/posts/2374382455978213/ but still not able to figure it out. I'm still reading his book as of now though 🙂 2021-09-07 12:07:44:275 [TID 5084][ERROR ] [EMVCException] Not Found (Custom message: "GET /test.dll/api/reversedstrings/hello") [dmvcframework] 2021-09-07 12:08:01:919 [TID 5084][INFO ] GET:/test.dll/api/ [100.100.100.123] -> {NOT FOUND} - 404 Not Found [dmvcframework] 2021-09-07 12:08:01:919 [TID 5084][ERROR ] [EMVCException] Not Found (Custom message: "GET /test.dll/api/") [dmvcframework] These are the logs the dmvc framework generated. some configuration issue? The way I'm interpreting this is it cannot find/route if the dll is included. But this is need for ISAPI implementation I resolved it after sometime I added test.dll as part of the default MVCPath, so it looks like this: [MVCPath('/test.dll/api')] Not sure if this is how it should be but in Datasnap it was different. We'll see
  13. misc_bb

    SVG Library

    I would like to ask if you can recommend some SVG library that can convert SVG to PNG/BMP/JPEG? Thanks!
  14. misc_bb

    SVG Library

    Thank you Angus! Honestly, I was just looking at it right now 🙂 Awesome man!
  15. misc_bb

    Working with SVG in OpenXML SDK in Delphi

    Yeah this is a bit of a pain. We have our existing implementation with Open Office/Libre Office and it works fine but we want to support SVG in our document generator this time. Just going thru with the SDK alone is already tedious. I would love to utilized a component or office library for this one but even the libraries like Axolot does not support SVG. I would love try your approach but for now one of my requirements is to generate a document file then a PDF as well. I don't want to have a .net dll as well but we'll see how this goes. Thanks a lot!
  16. Anyone integrating an API with Delphi (currently using Delphi Sydney 10.4) with accounting software like Quickbooks? I wonder if anyone encountered an issue with REST components integration with Quickbooks. Currently, we already have an implementation with Xero and MYOB using the same structure which is working really well. However, when I implemented the same with Quickbooks I got a empty JSON string with no errors at all or whatsoever. Quickbooks API did return me an authentication code but exchanging this code for the access token leaves me nothing. It just return an empty JSON string with no errors or exception. Any idea where I can further check on this within the Delphi environment? I'm also requesting a trace for my API integration with Quickbooks support to see if the request really push thru. Any input would be appreciated. Many thanks!
  17. I'm trying to test out this DirectOffice library but their demo project is really very limited. I need a little help. Their library file is quite big which can be found here Demo. But let me just point out some since I'm a bit confuse with the IComparable in assigning the value to the property. I'm trying to compare some C# code and convert the same code in Delphi. Consider this code (C#): MainDocumentPart mainDocumentPart = doc.AddMainDocumentPart(); mainDocumentPart.Document = new Document(); Body body = mainDocumentPart.Document.AppendChild(new Body()); Paragraph para = body.AppendChild(new Paragraph()); Run run =para.AppendChild(new Run()); RunProperties runProperties = run.AppendChild(new RunProperties()); FontSize fontSize = new FontSize(); fontSize.Val = "40"; runProperties.AppendChild(fontSize); run.AppendChild(new Text("Welcome!!!!!")); mainDocumentPart.Document.Save(); Using the DirectOffice library, it would look like this in Delphi: MainPart := WordDocument.AddMainDocumentPart; // create document Document := CoDocument.Create; MainPart.Document := Document; // create body Body := CoBody.Create; Document.AppendChild(Body as _OpenXmlElement); // create paragraph Paragraph := CoDocumentFormat_OpenXml_Wordprocessing_Paragraph.Create; Body.AppendChild(Paragraph as _OpenXmlElement); // create run Run := CoDocumentFormat_OpenXml_Wordprocessing_Run.Create; Paragraph.AppendChild(Run as _OpenXmlElement); Runproperties := CoDocumentFormat_OpenXml_Wordprocessing_RunProperties.Create; Fontsize := CoDocumentFormat_OpenXml_Wordprocessing_FontSize.Create; Fontsize.Val := '40'; //this error, Incompatible types: IComparable and string The last line is obviously a string, I'm not sure how I can convert it to iComparable type. Base on the DirectOffice.pas library, the following are the declarations. Can someone guide me perhaps in what I can look into next? _DocumentFormat_OpenXml_Wordprocessing_FontSize = interface(IDispatch) _DocumentFormat_OpenXml_Wordprocessing_FontSizeDisp = dispinterface property Val: IComparable read Get_Val write _Set_Val; Any response is appreciated. Thanks much!
  18. misc_bb

    Testing out DirectOffice Library

    I'm not so familiar with late binding in Delphi but I'll look into it. Thank you Anders.
  19. misc_bb

    Testing out DirectOffice Library

    The IComparable is part of the Delphi Generics I believe, in their library they have IComparable set to any type: Base64BinaryValue = IComparable; Base64BinaryValueClass = _Base64BinaryValueClass; BooleanValue = IComparable; BooleanValueClass = _BooleanValueClass; ByteValue = IComparable; ByteValueClass = _ByteValueClass; DateTimeValue = IComparable; DateTimeValueClass = _DateTimeValueClass; DecimalValue = IComparable; DecimalValueClass = _DecimalValueClass; DoubleValue = IComparable; DoubleClass = _DoubleClass; EnumStringAttribute = _EnumStringAttribute; HexBinaryValue = IComparable; HexBinaryValueClass = _HexBinaryValueClass; Int16Value = IComparable; Int16ValueClass = _Int16ValueClass; Int32Value = IComparable; Int32ValueClass = _Int32ValueClass; Int64Value = IComparable; Then the interface declarations: _DocumentFormat_OpenXml_Wordprocessing_FontSize = interface(IDispatch) ['{7F640590-6AD6-349C-AF4F-B9BECAB016FC}'] property Val: IComparable read Get_Val write _Set_Val; _DocumentFormat_OpenXml_Wordprocessing_FontSizeDisp = dispinterface ['{7F640590-6AD6-349C-AF4F-B9BECAB016FC}'] property Val: IComparable dispid 1610743883; //class declaration CoDocumentFormat_OpenXml_Wordprocessing_FontSize = class class function Create: DocumentFormat_OpenXml_Wordprocessing_FontSize; end; class function CoDocumentFormat_OpenXml_Wordprocessing_FontSize.Create: DocumentFormat_OpenXml_Wordprocessing_FontSize; begin Result := CreateComObject(CLASS_DocumentFormat_OpenXml_Wordprocessing_FontSize) as DocumentFormat_OpenXml_Wordprocessing_FontSize; end; I've just pick them where I can find the declaration intended for the Wordprocessing_FontSize. The DirectOffice.pas is around 48mb file. That file is really big and they also have the winsoft.directOffice.dll This library is acting like a wrapper for OpenXML in Delphi. I'm not sure if I sounded right here. Instead of directly modifying/interacting directly with OpenXML (or xml files), you can utilized this library for it. And after a while, I was able to get a workaround to make it work somehow but my solution now involves updating/manipulating the XML value. I've declared an OpenXMLAttribute variable and assign some values that will set the property I want to change. I'm not sure if this is the right approach with this library though but I think this is an option since it works. Just sharing this one for anyone who might be interested working with this library. //other declarations here xmlreader : OpenXmlAttribute; begin WordDocument := CoWordprocessingDocumentClass.Create.Create('bold.docx', WordprocessingDocumentType_Document); try xmlreader._namespaceUri := 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'; xmlreader.LocalName := 'val'; xmlreader.Prefix := 'w'; xmlreader.Value := '240'; MainPart := WordDocument.AddMainDocumentPart; // create document Document := CoDocument.Create; MainPart.Document := Document; // create body Body := CoBody.Create; Document.AppendChild(Body as _OpenXmlElement); // create paragraph Paragraph := CoDocumentFormat_OpenXml_Wordprocessing_Paragraph.Create; Body.AppendChild(Paragraph as _OpenXmlElement); // create run Run := CoDocumentFormat_OpenXml_Wordprocessing_Run.Create; Paragraph.AppendChild(Run as _OpenXmlElement); Runproperties := CoDocumentFormat_OpenXml_Wordprocessing_RunProperties.Create; Run.AppendChild(Runproperties as _OpenXmlElement); Bold := CoDocumentFormat_OpenXml_Wordprocessing_Bold.Create; Runproperties.Bold := (Bold as _DocumentFormat_OpenXml_Wordprocessing_Bold); // create text Text := CoDocumentFormat_OpenXml_Wordprocessing_Text.Create; Text.Text := 'Hello, ! lets get to work!!!'; Run.AppendChild(Text as _OpenXmlElement); //2nd paragraph // create paragraph Paragraph := CoDocumentFormat_OpenXml_Wordprocessing_Paragraph.Create; Body.AppendChild(Paragraph as _OpenXmlElement); // create run Run := CoDocumentFormat_OpenXml_Wordprocessing_Run.Create; Paragraph.AppendChild(Run as _OpenXmlElement); Runproperties := CoDocumentFormat_OpenXml_Wordprocessing_RunProperties.Create; Run.AppendChild(Runproperties as _OpenXmlElement); Fontsize := CoDocumentFormat_OpenXml_Wordprocessing_FontSize.Create; fontsize.SetAttribute(xmlreader); Runproperties.FontSize := (Fontsize as _DocumentFormat_OpenXml_Wordprocessing_FontSize); // create text Text := CoDocumentFormat_OpenXml_Wordprocessing_Text.Create; Text.Text := 'This is so weird!'; Run.AppendChild(Text as _OpenXmlElement); finally WordDocument.Dispose; end; ShellExecute(Handle, 'open', 'bold.docx', nil, nil, SW_SHOWNORMAL); end;
  20. It's either I'm not familiar with objects entirely or I'm desperate for help. I'm sorry in advance for asking this one but I just want to understand this further on how can this C# code be translated to Delphi? // Create a TableProperties object and specify its border information. TableProperties tblProp = new TableProperties( new TableBorders( new TopBorder() { Val = new EnumValue<BorderValues>(BorderValues.Dashed), Size = 24 }, new BottomBorder() { Val = new EnumValue<BorderValues>(BorderValues.Dashed), Size = 24 }, new LeftBorder() { Val = new EnumValue<BorderValues>(BorderValues.Dashed), Size = 24 }, new RightBorder() { Val = new EnumValue<BorderValues>(BorderValues.Dashed), Size = 24 }, new InsideHorizontalBorder() { Val = new EnumValue<BorderValues>(BorderValues.Dashed), Size = 24 }, new InsideVerticalBorder() { Val = new EnumValue<BorderValues>(BorderValues.Dashed), Size = 24 } ) ); This code is part of the OpenXML library for creating word documents.
  21. misc_bb

    Need some enlightenment

    Sorry, Daniel. I promise this won't happen again in my future post. 🙂
  22. misc_bb

    Need some enlightenment

    @corneliusdavid Thank you for the response. Yes, I have read that blog was well. Although, in this case we are exploring on the use of the DirectOffice library from Winsock. Nothing is final yet but that blog somehow gave me a very good insight in terms of what we can do. In relation to the code above, the TableBorders and Tableproperties parameters are actually TOleEnum as define in the DirectOffice library. I will continue looking into the definitions. I highly appreciate the response. Thanks again!
  23. misc_bb

    How to Export a PowerPoint PPTX File?

    Anyone have tried this Direct Office Library recently? How was it?
  24. Were doing 10.4 for Quickbooks integration using REST components
  25. This is a sample test app with MS Graph. Not sure if there's a new version recently with MS Graph, if there is some parameters might change. This is just a simple app just for me to test if I can retrieved an expected JSON result. TestMSGraph.zip
×