Leaderboard
Popular Content
Showing content with the highest reputation on 05/17/22 in all areas
-
Manually 🙂
- 10 replies
-
Sorry, its probably too late. I had read it as: ... I dont have any issues IOS - Developer/Deployment certificate with Provisioning profile.
-
The error message looks like the designer tries to read values from a dfm file into a component that has not been created yet. Was this other project created with the same Delphi version? Does it open and compile in Delphi Alexandria? Does the form you are trying to use in the new project use any self-written or 3rd-party components you are not yet using in forms of the new project?
-
Install Raize components 6.1.10 in Delphi 10
Attila Kovacs replied to AndrewHoward's topic in General Help
Oh yes. Make sure RzComps.inc knows your current Delphi/Compiler version. You have to manually adjust it. -
Install Raize components 6.1.10 in Delphi 10
Attila Kovacs replied to AndrewHoward's topic in General Help
make sure there is no precompiled stuff with older delphi version like dcu, dcp etc... (backup the raize dir first) -
After some trial and error again, was able to figure it out. This integration is with the Datylon API & Delphi REST components which handles a PDF return type. Although free account in Datylon doesn't work with this API integration. If anyone want to implements the API or something similar, the following code can be utilized. You just need to add some error handling. Getauthorization - a function that return the Basic authentication with username and password 64bit encoded, small letter 'a' in 'authorization' is from datylon documentation templateid and datasource - these are datylon parameters that needs be followed based on Datylon documentation JSONStr - this is actually the JSON string that needs to be sent TRY RESTRequest := TRESTRequest.create(nil); RESTRequest.Client := TRESTClient.create(RESTRequest); RESTRequest.SynchronizedEvents := False; RESTRequest.Client.UserAgent := DatylonUserAgent; RESTRequest.Client.FallbackCharsetEncoding := 'raw'; RESTRequest.Client.BaseURL := datylon_BaseURI; RESTRequest.Client.ContentType := 'application/json'; RESTRequest.Client.Params.AddItem('authorization', Getauthorization, TRESTRequestParameterkind.pkHTTPHEADER, [TRESTRequestParameterOption.poDoNotEncode]); RESTRequest.Client.Params.AddItem('x-graph-template-id', templateid, TRESTRequestParameterkind.pkHTTPHEADER, [TRESTRequestParameterOption.poDoNotEncode]); RESTRequest.Client.Params.AddItem('x-graph-datasource-name', datasource, TRESTRequestParameterkind.pkHTTPHEADER, [TRESTRequestParameterOption.poDoNotEncode]); RESTRequest.Body.ClearBody; RestRequest.body.Add(JSONStr, ctAPPLICATION_JSON); // RESTRequest.Resource := 'render'; RESTRequest.Method := rmPOST; RESTRequest.Response := TRESTResponse.Create(RESTRequest); RESTRequest.Accept := 'application/pdf'; RESTRequest.Execute; Codesite.Send('AuthenticationProcess Result: ' + RESTRequest.Response.Content); Result := RESTRequest.Response.RawBytes; finally RESTRequest.Free; end; This code result will return rawbytes which you need to convert to a file. You need the FallbackCharsetEncoding to 'raw' - this I'm not sure but I've read this from here: https://community.embarcadero.com/de/component/easydiscuss/rest-request-error-to-get-pdf-attached-berlin-10-1?Itemid=1 I'm not even sure if it made a difference but I lost track of it which ones is working and which one is not when I was doing my trial and error. 🤣 the ultimate goal is to make it work haha This is for the bytes to file conversion: procedure TfrmMain.SaveBytesToFile(const Data: TBytes; const FileName: string); var Stream: TFileStream; begin Stream := TFileStream.Create(FileName, fmCreate); try if Data <> nil then Stream.WriteBuffer(Data[0], Length(Data)); finally Stream.Free; end; end; //This will call the REST function above RestResultFile := API.PDFProcess(LoadTextFromFile('text1.txt')); //text file here contains the JSON string SaveBytesToFile(RestResultFile, 'test.pdf'); Thank you guys for your ideas. It led me to this solution above. Cheers!
-
Kinda hard to do proper multi-branch management from within the Delphi IDE.
- 10 replies
-
2) and 4) surprised me much. I just call Tortoise's Commit and Log dialogs from IDE via Tools menu in any time and do Git stuff from there
- 10 replies
-
TortoiseGit with Delphi 10 Seattle
Der schöne Günther replied to karl Jonson's topic in General Help
TortoiseGit is not Git! Quote from the official documentation:- 10 replies
-
Why would you try to put these two together. You use TortoiseGit inside explorer surely.
- 10 replies
-
Install Raize components 6.1.10 in Delphi 10
Attila Kovacs replied to AndrewHoward's topic in General Help
there is a build script in the source dir -
(I apologise if I'm missing the context here.) Automatically and unconditionally sorting units alphabetically doesn't seem to be a good idea. If you have multiple units exposing the same identifier then changing the order of units in the uses clause changes how they are resolved, probably leading to unintended changes to runtime behaviour of your code.
-
Dave, you are a goldmine 🙂 There appears to be several must do, should do, could do (or do not's) that would help the fledgling developer to get started in a good way, and I bet those were hard earned learning points? I would love to see you author an article (or a book) on the ins and outs of doing an Android app with Delphi! Thank you for all your contributions, and a Happy New Year to you!
-
I've just added a new demo: https://github.com/DelphiWorlds/Playground/tree/main/Demos/Advertising to the Playground repo