AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

MobileApps @ Apple App Store

Ein Thema von Darlo · begonnen am 26. Apr 2013 · letzter Beitrag vom 19. Jul 2013
Antwort Antwort
Benutzerbild von Phoenix
Phoenix
(Moderator)

Registriert seit: 25. Jun 2002
Ort: Hausach
7.643 Beiträge
 
#1

AW: MobileApps @ Apple App Store

  Alt 17. Jul 2013, 15:39
emm.... Mit PDF geht, meinte ich ein PDF zu erzeugen, nicht das "Umblättern" usw..
Mavarik
Preisfrage: wie erzeugst Du eine PDF mit Bordmitteln ?
http://developer.apple.com/library/i...ratingPDF.html
Sebastian Gingter
Phoenix - 不死鳥, Microsoft MVP, Rettungshundeführer
Über mich: Sebastian Gingter @ Thinktecture Mein Blog: https://gingter.org
  Mit Zitat antworten Zitat
Benutzerbild von Mavarik
Mavarik

Registriert seit: 9. Feb 2006
Ort: Stolberg (Rhld)
4.157 Beiträge
 
Delphi 10.3 Rio
 
#2

AW: MobileApps @ Apple App Store

  Alt 17. Jul 2013, 15:46
OK! Du warst zwar schneller, aber ich habe ein Delphi Beispiel

Delphi-Quellcode:
procedure TForm6.Button1Click(Sender: TObject);
var
  pdfContext : CGConTextRef;
  Path : CFStringRef;
  URL : CFURLRef;
  myDictionary : CFMutableDictionaryRef;
  PageRect : CGRect;
  Filename,
  Title,
  Creator : String;
  DPI : Integer;
begin
  DPI := 72;
  PageRect.origin.x := 0;
  PageRect.origin.y := 0;
  PageRect.size.width := 8*DPI;
  PageRect.size.height := 11*DPI;


  Filename := GetHomePath + PathDelim + 'Documents' + PathDelim+'MyPDF.PDF';
  path := CFStringCreateWithCString (NIL, MarshaledAString(utf8Encode(Filename)),kCFStringEncodingUTF8);
  url := CFURLCreateWithFileSystemPath (Nil, path, kCFURLPOSIXPathStyle, false);
  CFRelease(path);

  // This dictionary contains extra options mostly for 'signing' the PDF
  myDictionary := CFDictionaryCreateMutable(NIL, 0,NIL,NIL);
// @kCFTypeDictionaryKeyCallBacks,
// @kCFTypeDictionaryValueCallBacks);
  Title := 'kCGPDFContextTitle';
  Creator := 'kCGPDFContextCreator';
  CFDictionarySetValue(myDictionary, @Title, CFSTR('My PDF File'));
  CFDictionarySetValue(myDictionary, @Creator, CFSTR('Mavarik'));

  // Create our PDF Context with the CFURL, the CGRect we provide, and the above defined dictionary
  pdfContext := CGPDFContextCreateWithURL(url, @pageRect, CFDictionaryRef(myDictionary));
  CFRelease(url);

  // Done creating our PDF Context, now it's time to draw to it
  // Starts our first page
  CGContextBeginPage (pdfContext, @pageRect);

    // Draws a black rectangle around the page inset by 50 on all sides
  CGContextStrokeRect(pdfContext, CGRectMake(50, 50, pageRect.size.width - 100, pageRect.size.height - 100));

  CGContextSelectFont (pdfContext, 'Helvetica', 16, kCGEncodingMacRoman);
  CGContextSetTextDrawingMode (pdfContext, kCGTextFill);
  CGContextSetRGBFillColor (pdfContext, 0, 0, 0, 1);
  CGContextShowTextAtPoint (pdfContext, 100, 100, 'Hallo World PDF1', strlen('Hallo World PD1'));
  CGContextShowTextAtPoint (pdfContext, 100, 200, 'Hallo World PDF2', strlen('Hallo World PD2'));
  CGContextShowTextAtPoint (pdfContext, 200, 300, 'Hallo World PDF3', strlen('Hallo World PD3'));
  CGContextEndPage (pdfContext);

  // We are done with our context now, so we release it
  CGContextRelease (pdfContext);
  CFRelease(MyDictionary);

    {
    // This code block will create an image that we then draw to the page
    const char *picture = "Picture";
    CGImageRef image;
    CGDataProviderRef provider;
    CFStringRef picturePath;
    CFURLRef pictureURL;

    picturePath = CFStringCreateWithCString (NULL, picture,
                                            kCFStringEncodingUTF8);
    pictureURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(), picturePath, CFSTR("png"), NULL);
    CFRelease(picturePath);
    provider = CGDataProviderCreateWithURL (pictureURL);
    CFRelease (pictureURL);
    image = CGImageCreateWithPNGDataProvider (provider, NULL, true, kCGRenderingIntentDefault);
    CGDataProviderRelease (provider);
    CGContextDrawImage (pdfContext, CGRectMake(200, 200, 207, 385),image);
    CGImageRelease (image);
    // End image code

    // Adding some text on top of the image we just added
    CGContextSelectFont (pdfContext, "Helvetica", 16, kCGEncodingMacRoman);
    CGContextSetTextDrawingMode (pdfContext, kCGTextFill);
    CGContextSetRGBFillColor (pdfContext, 0, 0, 0, 1);
    const char *text = "Hello World!";
    CGContextShowTextAtPoint (pdfContext, 260, 390, text, strlen(text));
    // End text
    }

    // We are done drawing to this page, let's end it
    // We could add as many pages as we wanted using CGContextBeginPage/CGContextEndPage

    Webbrowser1.Navigate('file://'+GetHomePath + PathDelim + 'Documents' + PathDelim+'MyPDF.PDF');
end;

Grüsse Mavarik
  Mit Zitat antworten Zitat
Benutzerbild von Union
Union

Registriert seit: 18. Mär 2004
Ort: Luxembourg
3.492 Beiträge
 
Delphi 7 Enterprise
 
#3

AW: MobileApps @ Apple App Store

  Alt 17. Jul 2013, 16:17
Und das geht auf iOS? Sieht nach OSX aus...
Ibi fas ubi proxima merces
sudo /Developer/Library/uninstall-devtools --mode=all
  Mit Zitat antworten Zitat
Benutzerbild von Phoenix
Phoenix
(Moderator)

Registriert seit: 25. Jun 2002
Ort: Hausach
7.643 Beiträge
 
#4

AW: MobileApps @ Apple App Store

  Alt 17. Jul 2013, 17:09
Die API listet Apple als
Zitat:
Drawing and Printing Guide for iOS
.
Sebastian Gingter
Phoenix - 不死鳥, Microsoft MVP, Rettungshundeführer
Über mich: Sebastian Gingter @ Thinktecture Mein Blog: https://gingter.org
  Mit Zitat antworten Zitat
Benutzerbild von Mavarik
Mavarik

Registriert seit: 9. Feb 2006
Ort: Stolberg (Rhld)
4.157 Beiträge
 
Delphi 10.3 Rio
 
#5

AW: MobileApps @ Apple App Store

  Alt 17. Jul 2013, 22:42
Und das geht auf iOS? Sieht nach OSX aus...
Ja funktioniert...
  Mit Zitat antworten Zitat
Benutzerbild von Union
Union

Registriert seit: 18. Mär 2004
Ort: Luxembourg
3.492 Beiträge
 
Delphi 7 Enterprise
 
#6

AW: MobileApps @ Apple App Store

  Alt 18. Jul 2013, 00:18
Und das geht auf iOS? Sieht nach OSX aus...
Ja funktioniert...
Ich war nur mal wieder verwirrt wegen der lustigen Namespaces die verwendet wurden. In diesem Fall steckt das ja in iOS.CoreGraphics aber auch Macapi.CoreFoundation.
Ibi fas ubi proxima merces
sudo /Developer/Library/uninstall-devtools --mode=all
  Mit Zitat antworten Zitat
arnof

Registriert seit: 25. Apr 2013
1.261 Beiträge
 
Delphi 10.1 Berlin Enterprise
 
#7

AW: MobileApps @ Apple App Store

  Alt 18. Jul 2013, 02:00
@ Mavarik: mal Danke; aber unter Bordmitteln verstehe ich eine eigene Komponente oder Delphieigene Funktion; mit Zugriff auf die API's kann man ja alles selbst machen .... die PDF's will man z.B. auch in der Delphiversion für den grünen Roboter haben ..... da muss man das alles doppelt Programmieren ....

Zu den Appstore:

Heute Nacht hatte ich es am Magen, wie immer weiss der mehr; also mal in die Mails geschaut und der Magen hatte wie immer recht: Review ist nun gestartet und nach 20 min wieder abgebrochen! Was die genau wollen ist mir Rätselhaft; Ich solle Barcodeurls hochladen + Sie benötigen vollen Zugriff und ich soll einen Demoaccount anlegen nun lasse ich es morgen nochmals mit klaren Kopf übersetzen was die genau wollen....

Geändert von arnof (18. Jul 2013 um 02:04 Uhr)
  Mit Zitat antworten Zitat
Benutzerbild von Union
Union

Registriert seit: 18. Mär 2004
Ort: Luxembourg
3.492 Beiträge
 
Delphi 7 Enterprise
 
#8

AW: MobileApps @ Apple App Store

  Alt 18. Jul 2013, 06:46
Naja, die wollen testen. Bei einer "normalen" App wird ja alles durch Controls vom Benutzer ausgelöst oder DB-, WEB- und Timerbafragen. Das kann man direkt testen. Jetzt wollen sie eine URL wo sie Barcodes finden um zu testen was passiert wenn man die scannt.
Ibi fas ubi proxima merces
sudo /Developer/Library/uninstall-devtools --mode=all
  Mit Zitat antworten Zitat
Benutzerbild von Mavarik
Mavarik

Registriert seit: 9. Feb 2006
Ort: Stolberg (Rhld)
4.157 Beiträge
 
Delphi 10.3 Rio
 
#9

AW: MobileApps @ Apple App Store

  Alt 18. Jul 2013, 09:07
@ Mavarik: mal Danke; aber unter Bordmitteln verstehe ich eine eigene Komponente oder Delphieigene Funktion; mit Zugriff auf die API's kann man ja alles selbst machen .... die PDF's will man z.B. auch in der Delphiversion für den grünen Roboter haben ..... da muss man das alles doppelt Programmieren ....
OK wenn Du es so siehst... Zu Android kann ich "noch" nix sagen im Bezug auf PDF's, aber

Bordmitteln heißt für mich ich muss keine Komponente kaufen, den iOS kann das schon selber... Ist mehr als was Windows kann.

Klar wäre es schön, z.B. SynPDF für FMX zu haben... Nach 2h Konvertierung habe ich aufgegeben.

Man könnte auch einen Webservice nutzen, aber dann kannst Du nur PDF's erzeuge, wenn Du eine Online-Verbindung hast. auch nicht so schön.

Mavarik
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:56 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz