从序列化实体创建pdf [英] creating pdf from serialized entity

查看:104
本文介绍了从序列化实体创建pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我在点网中创建了一个pdf文件,并将其转换为字节数组.将其放置在一个实体中并进行序列化(json序列化).响应以字符串形式并通过http服务发送到iphone.

在iPhone中,我使用过

Hi everybody,
I created a pdf in dot net and it is converted to byte array.It is placed in an entity and serialized(json serialization).The response is in the form of string and send through a http service to iphone.

In iPhone i used

NSXMLParser * parser = [[NSXMLParser alloc]initWithData:webData];
[parser setDelegate:self];
[parser parse];


和xml解析器方法将响应保存为字符串


and xml parser method hold the response as string

-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
{ }


上面的函数参数字符串保存响应值.


the above function parameter string hold the response value.

{"PDF":[37,80,68,70,45,49,46,55,32,10,37,226,227,207,211,32,10,49,32,48,32,111,98,106,32,10,60,60,32,10,47,84,121,112,101,32,47,67,97,116,97,108,111,103,32,10,47,80,97,103,101,115,32,50,32,48,32,82,32,10,47,80,97,103,101,77,111,100,101,32,47,85,115,101,78,111,110,101,32,10,47,86,105,101,119,101,114,80,114,101,102,101,114,101,110,99,101,115,32,60,60,32,10,47,70,105,116,87,105,110,100,111,119,32,116,114,117,101,32,10,47,80,97,103,101,76,97,121,111,117,116,32,47,83,….]}


推荐答案

如果您要将数据发送到iphone,为什么要将其转换为pdf?
如果要发送pdf,请不要使用json,因为json用于发送对象或数据,而不是字节或数据流.
使用不同的技术将pdf下载到iphone,例如为iphone提供关于文件目标的绝对路径,并在iphone中搜索文件下载.
您的问题令人困惑
if you want to send data to iphone why are you converting it to pdf?
and if you want to send a pdf dont use json, as json is used to send objects or data not bytes or streams of data.
Use different technique to download the pdf to iphone, like give an absolute path to iphone about your files destination, and search for file downloading in iphone.
Your question is confusing


这篇关于从序列化实体创建pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆