我搜索一种方法来将我的转换成一个pdf,然后将它自动发送到云存储中。用户进程:
1-填写表格2-提交表格
从用户3隐藏进程-从表单数据4创建一个pdf -将其存储到云存储中
我更新了我的问题,并提供了更多细节。例如,我在我的应用程序中有一个表单,最后我想要一个pdf文件按钮来创建具有用户值的PDF,并将它发送到服务器上保存在云上。
这是我的表格
import React, { useState } from 'react';
import BouncyCheckbox from "react-native-bouncy-checkbox";
import {
ScrollView,
StyleSheet,
Dimensions,
TouchableOpacity
} from "react-native";
// Galio components
import { Block, Text, Button as GaButton, theme } from "galio-
framework";
// Argon themed components
import { argonTheme, tabs, articles } from "../constants/";
import { Input, Button, View, Card, Select, Icon, Header,
Switch } from "../components/";
const { width } = Dimensions.get("screen");
class Tall extends React.Component {
state = {
"switch-1": true,
"switch-2": false
};
renderText = () => {
return (
<Block flex style={styles.group}>
<Text size={22} style={styles.title}>
1 - HEIGHT
</Text>
<Block style={{ paddingHorizontal: theme.SIZES.BASE }}>
<Text size={18}
h3
style={{ fontFamily: 'open-sans-regular',
marginBottom: theme.SIZES.BASE / 1 }}
color={argonTheme.COLORS.DEFAULT}
>
- ARE YOU TALL ?
</Text>
</Block>
</Block>
);
};
renderSwitches = () => {
return (
<Block flex style={styles.group}>
<Block style={{ paddingHorizontal: theme.SIZES.BASE }}>
<Block
row
middle
space="between"
style={{ marginBottom: theme.SIZES.BASE }}
>
<Text style={{ fontFamily: 'open-sans-regular' }} size={14} color={argonTheme.COLORS.TEXT}>YES</Text>
<BouncyCheckbox
size={25}
fillColor="green"
unfillColor="#FFFFFF"
iconStyle={{ borderColor: "green" }}
onPress={(isChecked: boolean) => {}}
/>
</Block>
<Block row middle space="between">
<Text style={{ fontFamily: 'open-sans-regular' }} size={14} color={argonTheme.COLORS.TEXT}>NO</Text>
<BouncyCheckbox
size={25}
fillColor="red"
unfillColor="#FFFFFF"
iconStyle={{ borderColor: "red" }}
onPress={(isChecked: boolean) => {}}
/>
</Block>
</Block>
</Block>
);
};
renderButtons = () => {
return (
<Block flex>
<Block center>
<Button textStyle={{ fontFamily: 'open-sans-bold' }} color="success" style={styles.button}>
SEND
</Button>
</Block>
</Block>
);
};
render() {
return (
<Block flex center>
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={{ paddingBottom: 30, width }}
>
{this.renderText()}
{this.renderSwitches()}
{this.renderButtons()}
</ScrollView>
</Block>
);
}
}
const styles = StyleSheet.create({
title: {
fontFamily: 'open-sans-bold',
paddingBottom: theme.SIZES.BASE,
paddingHorizontal: theme.SIZES.BASE * 2,
marginTop: 44,
color: argonTheme.COLORS.HEADER
},
group: {
paddingTop: theme.SIZES.BASE * 2
},
shadow: {
shadowColor: "black",
shadowOffset: { width: 0, height: 2 },
shadowRadius: 4,
shadowOpacity: 0.2,
elevation: 2
},
button: {
marginBottom: 40,
marginTop: 80,
width: width - theme.SIZES.BASE * 2
},
optionsButton: {
width: "auto",
height: 34,
paddingHorizontal: theme.SIZES.BASE,
paddingVertical: 10
},
input: {
borderBottomWidth: 1
},
inputDefault: {
borderBottomColor: argonTheme.COLORS.PLACEHOLDER
},
inputTheme: {
borderBottomColor: argonTheme.COLORS.PRIMARY
},
inputTheme: {
borderBottomColor: argonTheme.COLORS.PRIMARY
},
inputInfo: {
borderBottomColor: argonTheme.COLORS.INFO
},
inputSuccess: {
borderBottomColor: argonTheme.COLORS.SUCCESS
},
});
export default Tall;如何使用世博打印检索用户选择(您高吗?)是还是否)在const HTML中?
发布于 2022-02-03 17:37:47
是的,可以用世博会的印刷品。
const user = {
name: 'Foub',
surname: 'Bouf'
};
const html = `<div style="color: red">Mr.${user.name} ${user.surname}</div>`;
const { base64 } = await Print.printToFileAsync({
html
});
// send the base64 which is a string containing the pdf's data to the server你可以把你想要的任何HTML和你想要的样式放在一起,就像一个真正的HTML页面
https://stackoverflow.com/questions/70975704
复制相似问题